From 4a46ab8de9a9a9aee36546740c45b9e65a9e7dc9 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 15 Aug 2018 14:14:46 +0200 Subject: cmdline: always use save_cmdline before command_line_enter ":normal :" might be invoked in various ways, so its safest to always allow recursive invocation of cmdline mode --- test/functional/ex_cmds/cmd_map_spec.lua | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'test/functional/ex_cmds/cmd_map_spec.lua') diff --git a/test/functional/ex_cmds/cmd_map_spec.lua b/test/functional/ex_cmds/cmd_map_spec.lua index 77d025dcc7..acb76e382d 100644 --- a/test/functional/ex_cmds/cmd_map_spec.lua +++ b/test/functional/ex_cmds/cmd_map_spec.lua @@ -656,7 +656,6 @@ describe('mappings with ', function() end) it('works in cmdline mode', function() - cmdmap('', 'call setcmdpos(2)') feed(':text') eq('c', eval('m')) -- didn't leave cmdline mode @@ -768,5 +767,32 @@ describe('mappings with ', function() end) + it("doesn't crash when invoking cmdline mode recursively #8859", function() + cmdmap('', 'norm! :foo') + feed(':bar') + screen:expect([[ + some short lines | + of test text | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + :bar^ | + ]]) + + feed('x') + screen:expect([[ + some short lines | + of test text | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + :barx^ | + ]]) + end) + end) -- cgit