aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-07 08:57:29 +0800
committerGitHub <noreply@github.com>2022-12-07 08:57:29 +0800
commitad244a865be5332471ec07875603c3dd4a7af0ae (patch)
tree2b0697ba15b535176dd41487c3721267c20006f9 /test
parenta069e88b4ea593419181271bfb41154e45b81090 (diff)
downloadrneovim-ad244a865be5332471ec07875603c3dd4a7af0ae.tar.gz
rneovim-ad244a865be5332471ec07875603c3dd4a7af0ae.tar.bz2
rneovim-ad244a865be5332471ec07875603c3dd4a7af0ae.zip
fix(events): save v:event for cmdline autocommands separately (#21316)
Diffstat (limited to 'test')
-rw-r--r--test/functional/autocmd/cmdline_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/autocmd/cmdline_spec.lua b/test/functional/autocmd/cmdline_spec.lua
index 8ec06dc148..c96501ead4 100644
--- a/test/functional/autocmd/cmdline_spec.lua
+++ b/test/functional/autocmd/cmdline_spec.lua
@@ -185,6 +185,14 @@ describe('cmdline autocommands', function()
eq({'notification', 'CmdlineLeave', {{cmdtype='=', cmdlevel=2, abort=false}}}, next_msg())
end)
+ it('no crash with recursive use of v:event #19484', function()
+ command('autocmd CmdlineEnter * normal :')
+ feed(':')
+ eq({'notification', 'CmdlineEnter', {{cmdtype=':', cmdlevel=1}}}, next_msg())
+ feed('<CR>')
+ eq({'notification', 'CmdlineLeave', {{cmdtype=':', cmdlevel=1, abort=false}}}, next_msg())
+ end)
+
it('supports CmdlineChanged' ,function()
command("autocmd CmdlineChanged * call rpcnotify(g:channel, 'CmdlineChanged', v:event, getcmdline())")
feed(':')