comparison src/testdir/test_terminal.vim @ 20474:3fe45aa3bbc5 v8.2.0791

patch 8.2.0791: a second popup window with terminal causes trouble Commit: https://github.com/vim/vim/commit/b5383b174b2436b556f76f14badb1c1f55d6d8f6 Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 18 19:46:48 2020 +0200 patch 8.2.0791: a second popup window with terminal causes trouble Problem: A second popup window with terminal causes trouble. Solution: Disallow opening a second terminal-popup window. (closes https://github.com/vim/vim/issues/6101, closes #6103) Avoid defaulting to an invalid line number.
author Bram Moolenaar <Bram@vim.org>
date Mon, 18 May 2020 20:00:03 +0200
parents 9f34aae7f69d
children f28a49da879d
comparison
equal deleted inserted replaced
20473:992024e2f885 20474:3fe45aa3bbc5
2585 2585
2586 func Test_double_popup_terminal() 2586 func Test_double_popup_terminal()
2587 let buf1 = term_start(&shell, #{hidden: 1}) 2587 let buf1 = term_start(&shell, #{hidden: 1})
2588 let win1 = popup_create(buf1, {}) 2588 let win1 = popup_create(buf1, {})
2589 let buf2 = term_start(&shell, #{hidden: 1}) 2589 let buf2 = term_start(&shell, #{hidden: 1})
2590 let win2 = popup_create(buf2, {}) 2590 call assert_fails('call popup_create(buf2, {})', 'E861:')
2591 call popup_close(win1) 2591 call popup_close(win1)
2592 call popup_close(win2)
2593 exe buf1 .. 'bwipe!' 2592 exe buf1 .. 'bwipe!'
2594 exe buf2 .. 'bwipe!' 2593 exe buf2 .. 'bwipe!'
2595 endfunc 2594 endfunc
2596 2595
2597 func Test_issue_5607() 2596 func Test_issue_5607()
2617 2616
2618 func Test_term_nasty_callback() 2617 func Test_term_nasty_callback()
2619 CheckExecutable sh 2618 CheckExecutable sh
2620 2619
2621 set hidden 2620 set hidden
2622 let g:buf0 = term_start('sh', #{hidden: 1}) 2621 let g:buf0 = term_start('sh', #{hidden: 1, term_finish: 'close'})
2623 call popup_create(g:buf0, {}) 2622 call popup_create(g:buf0, {})
2624 let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'})
2625 call popup_create(g:buf1, {})
2626 call assert_fails("call term_start(['sh', '-c'], #{curwin: 1})", 'E863:') 2623 call assert_fails("call term_start(['sh', '-c'], #{curwin: 1})", 'E863:')
2627 2624
2628 call popup_clear(1) 2625 call popup_clear(1)
2629 set hidden& 2626 set hidden&
2630 endfunc 2627 endfunc