fix(events): save v:event for cmdline autocommands separately

(cherry picked from commit 4ef6efe927)
This commit is contained in:
zeertzjq
2022-12-07 08:27:49 +08:00
committed by github-actions[bot]
parent 9bd5ba83ab
commit ccb718a23d
2 changed files with 14 additions and 2 deletions

View File

@@ -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(':')