aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-13 04:14:29 +0800
committerGitHub <noreply@github.com>2024-07-13 04:14:29 +0800
commit16f63b964fc4a7842fd9a2fd5e0ba8c997d549c9 (patch)
tree1eff1b2ff523674d2723bbc49f25e5d0285544f6 /test/functional
parent8d8b8af2d2b837c9a7a4005b943a8a4c9bfc391d (diff)
downloadrneovim-16f63b964fc4a7842fd9a2fd5e0ba8c997d549c9.tar.gz
rneovim-16f63b964fc4a7842fd9a2fd5e0ba8c997d549c9.tar.bz2
rneovim-16f63b964fc4a7842fd9a2fd5e0ba8c997d549c9.zip
fix(input): handle vim.on_key() properly with ALT and K_SPECIAL (#29677)
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/editor/meta_key_spec.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/functional/editor/meta_key_spec.lua b/test/functional/editor/meta_key_spec.lua
index 87fe395608..30027e2fd6 100644
--- a/test/functional/editor/meta_key_spec.lua
+++ b/test/functional/editor/meta_key_spec.lua
@@ -145,7 +145,8 @@ describe('meta-keys #8226 #13042', function()
end)
it('ALT/META with vim.on_key()', function()
- feed('ifoo<CR>bar<CR>baz<Esc>gg0')
+ feed('ifoo<CR>bar<CR>baz<Esc>gg0viw"ay')
+ command('nnoremap … "')
exec_lua [[
keys = {}
@@ -157,15 +158,15 @@ describe('meta-keys #8226 #13042', function()
end)
]]
- -- <M-"> is reinterpreted as <Esc>"
- feed('qrviw"ayc$FOO.<M-">apq')
+ -- <M-"> and <M-…> are reinterpreted as <Esc>" and <Esc>…
+ feed('c$FOO.<M-">apA.<M-…>ap')
expect([[
- FOO.foo
+ FOO.foo.foo
bar
baz]])
- -- vim.on_key() callback should only receive <Esc>"
- eq('qrviw"ayc$FOO.<Esc>"apq', exec_lua [[return table.concat(keys, '')]])
- eq('qrviw"ayc$FOO.<Esc>"apq', exec_lua [[return table.concat(typed, '')]])
+ -- vim.on_key() callback should only receive <Esc>" and <Esc>…
+ eq('c$FOO.<Esc>"apA.<Esc>"ap', exec_lua [[return table.concat(keys, '')]])
+ eq('c$FOO.<Esc>"apA.<Esc>…ap', exec_lua [[return table.concat(typed, '')]])
end)
end)