From 99d4c8c29c4a9371c268cc20e4805709d86fb686 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 20 Feb 2016 17:09:15 -0500 Subject: keymap: Support (super/command key). Adds support for: - api:vim_input("") - ":nnoremap " and permutations thereof UIs must capture the modifier and send it as "" to vim_input(). Note: Before this commit, any arbitrary ":nnoremap <{foo}-{bar}>" mapping could already be invoked with feedkeys("\<{foo}-{bar}>"). This commit supports "D-" as a modifier that can be combined with "C-", "A-", "S-" in any order. For non-GUI (terminal) support, user must: :set ={CSI sequence} then send the {CSI sequence} from their terminal. But this does not work yet (regression #2204). Closes #2190 --- test/functional/api/vim_spec.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'test/functional/api') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index f4a9ddc698..9c9759adf6 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -144,15 +144,23 @@ describe('vim_* functions', function() describe('replace_termcodes', function() it('escapes K_SPECIAL as K_SPECIAL KS_SPECIAL KE_FILLER', function() - eq(helpers.nvim('replace_termcodes', '\128', true, true, true), '\128\254X') + eq('\128\254X', helpers.nvim('replace_termcodes', '\128', true, true, true)) end) - it('leaves non K_SPECIAL string unchanged', function() - eq(helpers.nvim('replace_termcodes', 'abc', true, true, true), 'abc') + it('leaves non-K_SPECIAL string unchanged', function() + eq('abc', helpers.nvim('replace_termcodes', 'abc', true, true, true)) end) it('converts ', function() - eq(helpers.nvim('replace_termcodes', '', true, true, true), '\\') + eq('\\', helpers.nvim('replace_termcodes', '', true, true, true)) + end) + + it('converts to K_SPECIAL KS_EXTRA KE_LEFTMOUSE', function() + -- K_SPECIAL KS_EXTRA KE_LEFTMOUSE + -- 0x80 0xfd 0x2c + -- 128 253 44 + eq('\128\253\44', helpers.nvim('replace_termcodes', + '', true, true, true)) end) end) -- cgit