aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-02-20 17:09:15 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-02-22 02:41:40 -0500
commit99d4c8c29c4a9371c268cc20e4805709d86fb686 (patch)
tree6bedd829ee9f073f7940a2ed09ad6829318d71b5 /test/functional/api/vim_spec.lua
parent9403ce82bce1a2dcda4b01b10b2c01ee42bb4034 (diff)
downloadrneovim-99d4c8c29c4a9371c268cc20e4805709d86fb686.tar.gz
rneovim-99d4c8c29c4a9371c268cc20e4805709d86fb686.tar.bz2
rneovim-99d4c8c29c4a9371c268cc20e4805709d86fb686.zip
keymap: Support <D-...> (super/command key).
Adds support for: - api:vim_input("<D-a>") - ":nnoremap <C-D-S-...>" and permutations thereof UIs must capture the modifier and send it as "<D-...>" 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 <D-a>={CSI sequence} then send the {CSI sequence} from their terminal. But this does not work yet (regression #2204). Closes #2190
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua16
1 files changed, 12 insertions, 4 deletions
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 <expressions>', function()
- eq(helpers.nvim('replace_termcodes', '<Leader>', true, true, true), '\\')
+ eq('\\', helpers.nvim('replace_termcodes', '<Leader>', true, true, true))
+ end)
+
+ it('converts <LeftMouse> 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',
+ '<LeftMouse>', true, true, true))
end)
end)