aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-11-29 18:51:25 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-11-29 09:51:25 -0800
commitf33371c03f526ecbe2d6a1bec744fa37c1b2640c (patch)
tree3bbced520f8514a2b94f1bad22d0907713e65c86 /src/nvim/testdir
parente138c4c87407d3f7848a8b978de29e7aad610bab (diff)
downloadrneovim-f33371c03f526ecbe2d6a1bec744fa37c1b2640c.tar.gz
rneovim-f33371c03f526ecbe2d6a1bec744fa37c1b2640c.tar.bz2
rneovim-f33371c03f526ecbe2d6a1bec744fa37c1b2640c.zip
vim-patch:8.1.2017: cannot execute commands after closing cmdline window #11479
Problem: Cannot execute commands after closing the cmdline window. Solution: Also trigger BufEnter and WinEnter. (closes vim/vim#4762) https://github.com/vim/vim/commit/96e38a86a710fb6daec4550ac1667f019dc3a40e Fixes https://github.com/neovim/neovim/issues/11279.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cmdline.vim35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 56157bebec..262ea11eb6 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -619,6 +619,8 @@ func Check_cmdline(cmdtype)
return ''
endfunc
+set cpo&
+
func Test_getcmdtype()
call feedkeys(":MyCmd a\<C-R>=Check_cmdline(':')\<CR>\<Esc>", "xt")
@@ -659,6 +661,37 @@ func Test_getcmdwintype()
call assert_equal('', getcmdwintype())
endfunc
+func Test_getcmdwin_autocmd()
+ let s:seq = []
+ augroup CmdWin
+ au WinEnter * call add(s:seq, 'WinEnter ' .. win_getid())
+ au WinLeave * call add(s:seq, 'WinLeave ' .. win_getid())
+ au BufEnter * call add(s:seq, 'BufEnter ' .. bufnr())
+ au BufLeave * call add(s:seq, 'BufLeave ' .. bufnr())
+ au CmdWinEnter * call add(s:seq, 'CmdWinEnter ' .. win_getid())
+ au CmdWinLeave * call add(s:seq, 'CmdWinLeave ' .. win_getid())
+
+ let org_winid = win_getid()
+ let org_bufnr = bufnr()
+ call feedkeys("q::let a = getcmdwintype()\<CR>:let s:cmd_winid = win_getid()\<CR>:let s:cmd_bufnr = bufnr()\<CR>:q\<CR>", 'x!')
+ call assert_equal(':', a)
+ call assert_equal([
+ \ 'WinLeave ' .. org_winid,
+ \ 'WinEnter ' .. s:cmd_winid,
+ \ 'BufLeave ' .. org_bufnr,
+ \ 'BufEnter ' .. s:cmd_bufnr,
+ \ 'CmdWinEnter ' .. s:cmd_winid,
+ \ 'CmdWinLeave ' .. s:cmd_winid,
+ \ 'BufLeave ' .. s:cmd_bufnr,
+ \ 'WinLeave ' .. s:cmd_winid,
+ \ 'WinEnter ' .. org_winid,
+ \ 'BufEnter ' .. org_bufnr,
+ \ ], s:seq)
+
+ au!
+ augroup END
+endfunc
+
func Test_verbosefile()
set verbosefile=Xlog
echomsg 'foo'
@@ -717,5 +750,3 @@ func Test_cmdline_overstrike()
let &encoding = encoding_save
endfunc
-
-set cpo&