diff options
author | bfredl <bjorn.linse@gmail.com> | 2025-01-14 14:46:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 14:46:34 +0100 |
commit | 7eabc8899af8b2fed1472165b74f43965282974f (patch) | |
tree | 85332ffa92ee59b3aaa9ecfb2cbe27fee2429156 /test/functional | |
parent | 25d8c3a5ad7e9c5668841e66540ebe34ceda73a7 (diff) | |
parent | 913e81c35f162c1e2647565397608f63f38d7043 (diff) | |
download | rneovim-7eabc8899af8b2fed1472165b74f43965282974f.tar.gz rneovim-7eabc8899af8b2fed1472165b74f43965282974f.tar.bz2 rneovim-7eabc8899af8b2fed1472165b74f43965282974f.zip |
Merge pull request #31932 from bfredl/termtab
fix(getchar): do not simplify keycodes in terminal mode
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index cc807ba555..50e23d9e23 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -625,6 +625,74 @@ describe('terminal input', function() ]]):format(key)) end end) + + -- TODO(bfredl): getcharstr() erases the distinction between <C-I> and <Tab>. + -- If it was enhanced or replaced this could get folded into the test above. + it('can send TAB/C-I and ESC/C-[ separately', function() + clear() + local screen = tt.setup_child_nvim({ + '-u', + 'NONE', + '-i', + 'NONE', + '--cmd', + 'colorscheme vim', + '--cmd', + 'set notermguicolors', + '--cmd', + 'noremap <Tab> <cmd>echo "Tab!"<cr>', + '--cmd', + 'noremap <C-i> <cmd>echo "Ctrl-I!"<cr>', + '--cmd', + 'noremap <Esc> <cmd>echo "Esc!"<cr>', + '--cmd', + 'noremap <C-[> <cmd>echo "Ctrl-[!"<cr>', + }) + + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + | + {3:-- TERMINAL --} | + ]]) + + feed('<tab>') + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + Tab! | + {3:-- TERMINAL --} | + ]]) + + feed('<c-i>') + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + Ctrl-I! | + {3:-- TERMINAL --} | + ]]) + + feed('<Esc>') + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + Esc! | + {3:-- TERMINAL --} | + ]]) + + feed('<c-[>') + screen:expect([[ + ^ | + {4:~ }|*3 + {5:[No Name] 0,0-1 All}| + Ctrl-[! | + {3:-- TERMINAL --} | + ]]) + end) end) if is_os('win') then |