From 66747f18ded775e2c0b6bac73cee18a3752086af Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 25 Apr 2022 21:40:46 +0800 Subject: vim-patch:8.2.0839: dropping modifier when putting a character back in typeahead Problem: Dropping modifier when putting a character back in typeahead. Solution: Add modifier to ins_char_typebuf(). (closes vim/vim#6158) https://github.com/vim/vim/commit/b42c0d54279b1fdb79652db0c84171e213458809 Vim's test doesn't seem to work properly as the hit-enter prompt seems to be delayed. Add a Lua screen test. --- test/functional/ui/input_spec.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'test/functional') diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua index 8925dda730..799aad8d55 100644 --- a/test/functional/ui/input_spec.lua +++ b/test/functional/ui/input_spec.lua @@ -216,6 +216,39 @@ it('Ctrl-6 is Ctrl-^ vim-patch:8.1.2333', function() eq('aaa', funcs.bufname()) end) +it('typing a simplifiable key at hit-enter prompt triggers mapping vim-patch:8.2.0839', function() + local screen = Screen.new(60,8) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [2] = {bold = true, reverse = true}, -- MsgSeparator + [3] = {bold = true, foreground = Screen.colors.SeaGreen}, -- MoreMsg + }) + screen:attach() + command([[nnoremap echo 'hit ctrl-6']]) + feed_command('ls') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {2: }| + :ls | + 1 %a "[No Name]" line 1 | + {3:Press ENTER or type command to continue}^ | + ]]) + feed('') + screen:expect([[ + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + hit ctrl-6 | + ]]) +end) + describe('input non-printable chars', function() after_each(function() os.remove('Xtest-overwrite') -- cgit