aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/cmd_map_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-08-15 14:14:46 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2018-08-17 10:48:48 +0200
commit4a46ab8de9a9a9aee36546740c45b9e65a9e7dc9 (patch)
treef18400e6d38f68e07112ba5b734e9e089bfb8fff /test/functional/ex_cmds/cmd_map_spec.lua
parentb5cfac089409faf17a290d4bfe1b669212e2984e (diff)
downloadrneovim-4a46ab8de9a9a9aee36546740c45b9e65a9e7dc9.tar.gz
rneovim-4a46ab8de9a9a9aee36546740c45b9e65a9e7dc9.tar.bz2
rneovim-4a46ab8de9a9a9aee36546740c45b9e65a9e7dc9.zip
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
Diffstat (limited to 'test/functional/ex_cmds/cmd_map_spec.lua')
-rw-r--r--test/functional/ex_cmds/cmd_map_spec.lua28
1 files changed, 27 insertions, 1 deletions
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 <Cmd>', function()
end)
it('works in cmdline mode', function()
- cmdmap('<F2>', 'call setcmdpos(2)')
feed(':text<F3>')
eq('c', eval('m'))
-- didn't leave cmdline mode
@@ -768,5 +767,32 @@ describe('mappings with <Cmd>', function()
end)
+ it("doesn't crash when invoking cmdline mode recursively #8859", function()
+ cmdmap('<F2>', 'norm! :foo')
+ feed(':bar')
+ screen:expect([[
+ some short lines |
+ of test text |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :bar^ |
+ ]])
+
+ feed('<f2>x')
+ screen:expect([[
+ some short lines |
+ of test text |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :barx^ |
+ ]])
+ end)
+
end)