summaryrefslogtreecommitdiff
path: root/src/testdir/test_popupwin.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-18 19:46:48 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-18 19:46:48 +0200
commitb5383b174b2436b556f76f14badb1c1f55d6d8f6 (patch)
tree9ac5d993e3a2febe97c8c77e19e1928a47bcf739 /src/testdir/test_popupwin.vim
parent843700875e50c03c94245bef1b2de147b9b3b585 (diff)
downloadvim-git-b5383b174b2436b556f76f14badb1c1f55d6d8f6.tar.gz
patch 8.2.0791: a second popup window with terminal causes troublev8.2.0791
Problem: A second popup window with terminal causes trouble. Solution: Disallow opening a second terminal-popup window. (closes #6101, closes #6103) Avoid defaulting to an invalid line number.
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r--src/testdir/test_popupwin.vim13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index feaa5e4c0..8c917bc8e 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -2426,10 +2426,10 @@ func Test_popupwin_terminal_buffer()
let g:test_is_flaky = 1
let origwin = win_getid()
- let ptybuf = term_start(&shell, #{hidden: 1})
- let winid = popup_create(ptybuf, #{minwidth: 40, minheight: 10})
+ let termbuf = term_start(&shell, #{hidden: 1})
+ let winid = popup_create(termbuf, #{minwidth: 40, minheight: 10})
" Wait for shell to start
- call WaitForAssert({-> assert_equal("run", job_status(term_getjob(ptybuf)))})
+ call WaitForAssert({-> assert_equal("run", job_status(term_getjob(termbuf)))})
sleep 100m
" Check this doesn't crash
call assert_equal(winnr(), winnr('j'))
@@ -2440,11 +2440,16 @@ func Test_popupwin_terminal_buffer()
" Cannot quit while job is running
call assert_fails('call feedkeys("\<C-W>:quit\<CR>", "xt")', 'E948:')
- " Cannot enter Terminal-Normal mode.
+ " Cannot enter Terminal-Normal mode. (TODO: but it works...)
call feedkeys("xxx\<C-W>N", 'xt')
call assert_fails('call feedkeys("gf", "xt")', 'E863:')
call feedkeys("a\<C-U>", 'xt')
+ " Cannot open a second one.
+ let termbuf2 = term_start(&shell, #{hidden: 1})
+ call assert_fails('call popup_create(termbuf2, #{})', 'E861:')
+ call term_sendkeys(termbuf2, "exit\<CR>")
+
" Exiting shell closes popup window
call feedkeys("exit\<CR>", 'xt')
" Wait for shell to exit