summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-20 20:12:29 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-20 20:12:29 +0100
commit11ec807639ae642bf55da883918489e2cd9911ab (patch)
tree14706a1435fe7a0b74dd1d95f61902df2345c424 /src/testdir/test_terminal.vim
parent0bbf722aaaa75b1bbe87ef6afc44c5fff8e3893b (diff)
downloadvim-git-11ec807639ae642bf55da883918489e2cd9911ab.tar.gz
patch 8.2.0286: cannot use popup_close() for a terminal popupv8.2.0286
Problem: Cannot use popup_close() for a terminal popup. Solution: Allow using popup_close(). (closes #5666)
Diffstat (limited to 'src/testdir/test_terminal.vim')
-rw-r--r--src/testdir/test_terminal.vim17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index e0761c4bd..64bc7db1e 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -2337,8 +2337,8 @@ func Test_terminal_in_popup()
\ 'call setline(1, range(20))',
\ 'hi PopTerm ctermbg=grey',
\ 'func OpenTerm(setColor)',
- \ " let buf = term_start('" .. cmd .. " Xtext', #{hidden: 1, term_finish: 'close'})",
- \ ' let s:winid = popup_create(buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})',
+ \ " let s:buf = term_start('" .. cmd .. " Xtext', #{hidden: 1, term_finish: 'close'})",
+ \ ' let s:winid = popup_create(s:buf, #{minwidth: 45, minheight: 7, border: [], drag: 1, resize: 1})',
\ ' if a:setColor',
\ ' call win_execute(s:winid, "set wincolor=PopTerm")',
\ ' endif',
@@ -2347,6 +2347,12 @@ func Test_terminal_in_popup()
\ 'func HidePopup()',
\ ' call popup_hide(s:winid)',
\ 'endfunc',
+ \ 'func ClosePopup()',
+ \ ' call popup_close(s:winid)',
+ \ 'endfunc',
+ \ 'func ReopenPopup()',
+ \ ' call popup_create(s:buf, #{minwidth: 40, minheight: 6, border: []})',
+ \ 'endfunc',
\ 'sleep 10m',
\ 'redraw',
\ 'echo getwinvar(s:winid, "&buftype") win_gettype(s:winid)',
@@ -2370,6 +2376,13 @@ func Test_terminal_in_popup()
call term_sendkeys(buf, "\<CR>")
call term_wait(buf, 100)
+ call term_sendkeys(buf, "\<C-W>:call ClosePopup()\<CR>")
+ call VerifyScreenDump(buf, 'Test_terminal_popup_5', {})
+
+ call term_sendkeys(buf, "\<C-W>:call ReopenPopup()\<CR>")
+ call VerifyScreenDump(buf, 'Test_terminal_popup_6', {})
+ call term_wait(buf, 100)
+
call term_sendkeys(buf, ":q\<CR>")
call term_wait(buf, 100) " wait for terminal to vanish