summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-14 20:21:55 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-14 20:21:55 +0100
commit02764713a715c55e316e2bef5c9ade2fb767ee78 (patch)
tree64ab70ce1fa3c4af464254695b54aa46529fac82 /src/testdir/test_terminal.vim
parent33aecb1f2c85711d53858b71f5f3c2cbe076435f (diff)
downloadvim-git-02764713a715c55e316e2bef5c9ade2fb767ee78.tar.gz
patch 8.2.1985: crash when closing terminal popup with <Cmd> mappingv8.2.1985
Problem: Crash when closing terminal popup with <Cmd> mapping. Solution: Check b_term is not NULL. (closes #7294)
Diffstat (limited to 'src/testdir/test_terminal.vim')
-rw-r--r--src/testdir/test_terminal.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 137a8a605..8d68ceb5b 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -1225,6 +1225,18 @@ func Test_open_term_from_cmd()
call delete('Xopenterm')
endfunc
+func Test_terminal_popup_with_cmd()
+ " this was crashing
+ let buf = term_start(&shell, #{hidden: v:true})
+ let s:winid = popup_create(buf, {})
+ tnoremap <F3> <Cmd>call popup_close(s:winid)<CR>
+ call feedkeys("\<F3>", 'xt')
+
+ tunmap <F3>
+ exe 'bwipe! ' .. buf
+ unlet s:winid
+endfunc
+
func Check_dump01(off)
call assert_equal('one two three four five', trim(getline(a:off + 1)))
call assert_equal('~ Select Word', trim(getline(a:off + 7)))