aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-10 17:13:57 +0800
committerGitHub <noreply@github.com>2022-06-10 17:13:57 +0800
commite15d31b530c443daea04d7a772b24da737397c53 (patch)
treef96b0e467be8cfe832f3766a4d4062a4dc78cde7 /test
parent6eaf10502c99e96704daa07987f73658d6c4d68a (diff)
downloadrneovim-e15d31b530c443daea04d7a772b24da737397c53.tar.gz
rneovim-e15d31b530c443daea04d7a772b24da737397c53.tar.bz2
rneovim-e15d31b530c443daea04d7a772b24da737397c53.zip
fix(input): fix macro recording with ALT and special key (#18917)
Diffstat (limited to 'test')
-rw-r--r--test/functional/editor/meta_key_spec.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/functional/editor/meta_key_spec.lua b/test/functional/editor/meta_key_spec.lua
index 8efcc81616..23964ca10f 100644
--- a/test/functional/editor/meta_key_spec.lua
+++ b/test/functional/editor/meta_key_spec.lua
@@ -106,6 +106,7 @@ describe('meta-keys #8226 #13042', function()
end)
it('ALT/META when recording a macro #13235', function()
+ command('inoremap <M-Esc> <lt>M-ESC>')
feed('ifoo<CR>bar<CR>baz<Esc>gg0')
-- <M-"> is reinterpreted as <Esc>"
feed('qrviw"ayC// This is some text: <M-">apq')
@@ -113,7 +114,27 @@ describe('meta-keys #8226 #13042', function()
// This is some text: foo
bar
baz]])
- -- Should not insert an extra double quote when replaying
+ -- Should not insert an extra double quote or trigger <M-Esc> when replaying
+ feed('j0@rj0@@')
+ expect([[
+ // This is some text: foo
+ // This is some text: bar
+ // This is some text: baz]])
+ command('%delete')
+ end)
+
+ it('ALT/META with special key when recording a macro', function()
+ command('inoremap <M-Esc> <lt>M-ESC>')
+ command('noremap <S-Tab> "')
+ command('noremap! <S-Tab> "')
+ feed('ifoo<CR>bar<CR>baz<Esc>gg0')
+ -- <M-S-Tab> is reinterpreted as <Esc><S-Tab>
+ feed('qrviw<S-Tab>ayC// This is some text: <M-S-Tab>apq')
+ expect([[
+ // This is some text: foo
+ bar
+ baz]])
+ -- Should not insert an extra double quote or trigger <M-Esc> when replaying
feed('j0@rj0@@')
expect([[
// This is some text: foo