aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/tui_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/terminal/tui_spec.lua')
-rw-r--r--test/functional/terminal/tui_spec.lua21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 14700a2622..838d05a6df 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -53,7 +53,7 @@ describe('tui', function()
]])
end)
- it('interprets leading esc byte as the alt modifier', function()
+ it('interprets leading <Esc> byte as ALT modifier in normal-mode', function()
local keys = 'dfghjkl'
for c in keys:gmatch('.') do
execute('nnoremap <a-'..c..'> ialt-'..c..'<cr><esc>')
@@ -80,6 +80,25 @@ describe('tui', function()
]])
end)
+ it('does not mangle unmapped ALT-key chord', function()
+ -- Vim represents ALT/META by setting the "high bit" of the modified key;
+ -- we do _not_. #3982
+ --
+ -- Example: for input ALT+j:
+ -- * Vim (Nvim prior to #3982) sets high-bit, inserts "ê".
+ -- * Nvim (after #3982) inserts "j".
+ feed('i\x1bj')
+ screen:expect([[
+ j{1: } |
+ ~ |
+ ~ |
+ ~ |
+ [No Name] [+] |
+ -- INSERT -- |
+ -- TERMINAL -- |
+ ]])
+ end)
+
it('accepts ascii control sequences', function()
feed('i')
feed('\x16\x07') -- ctrl+g