From 0ea7e45bc1d1881f505da2b77e0b3e4eb56f12fe Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 13:21:38 +0200 Subject: 'cpoptions': remove "<" flag; ignore Closes #6937 "nvim_get_keymap output is unreliable" --- test/functional/api/keymap_spec.lua | 18 ++++++++---------- test/functional/api/vim_spec.lua | 13 +++++++++---- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'test/functional/api') diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index aa556b563d..3a10f9c60f 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -256,40 +256,38 @@ describe('get_keymap', function() return ret end - command('set cpo-=< cpo+=B') + command('set cpo+=B') command('nnoremap \\C-a>\\ \\C-b>\\') command('nnoremap \\C-c>\\ \\C-d>\\') - command('set cpo+=B<') + command('set cpo+=B') command('xnoremap \\C-a>\\ \\C-b>\\') command('xnoremap \\C-c>\\ \\C-d>\\') - command('set cpo-=B<') + command('set cpo-=B') command('snoremap \\C-a>\\ \\C-b>\\') command('snoremap \\C-c>\\ \\C-d>\\') - command('set cpo-=B cpo+=<') + command('set cpo-=B') command('onoremap \\C-a>\\ \\C-b>\\') command('onoremap \\C-c>\\ \\C-d>\\') for _, cmd in ipairs({ - 'set cpo-=B cpo+=<', - 'set cpo-=B<', - 'set cpo+=B<', - 'set cpo-=< cpo+=B', + 'set cpo-=B', + 'set cpo+=B', }) do command(cmd) eq({cpomap('\\C-c>\\', '\\C-d>\\', 'n'), cpomap('\\C-a>\\', '\\C-b>\\', 'n')}, meths.get_keymap('n')) eq({cpomap('\\C-c>\\', '\\C-d>\\', 'x'), - cpomap('\\C-a>C-a>LT>C-a>\\', '\\C-b>C-b>LT>C-b>\\', 'x')}, + cpomap('\\C-a>\\', '\\C-b>\\', 'x')}, meths.get_keymap('x')) eq({cpomap('C-c>C-c> ', 'C-d>C-d>', 's'), cpomap('C-a>C-a> ', 'C-b>C-b>', 's')}, meths.get_keymap('s')) eq({cpomap('C-c>C-c> ', 'C-d>C-d>', 'o'), - cpomap('C-a>C-a>LT>C-a> ', 'C-b>C-b>LT>C-b>', 'o')}, + cpomap('C-a>C-a> ', 'C-b>C-b>', 'o')}, meths.get_keymap('o')) end end) diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index c531d4af46..e59b5d712d 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -373,6 +373,11 @@ describe('api', function() 'xxxx', true, true, true)) end) + it('does not convert keycodes if special=false', function() + eq('xxxx', helpers.nvim('replace_termcodes', + 'xxxx', true, true, false)) + end) + it('does not crash when transforming an empty string', function() -- Actually does not test anything, because current code will use NULL for -- an empty string. @@ -391,13 +396,13 @@ describe('api', function() -- notice the special char(…) \xe2\80\xa6 nvim('feedkeys', ':let x1="…"\n', '', true) - -- Both replace_termcodes and feedkeys escape \x80 + -- Both nvim_replace_termcodes and nvim_feedkeys escape \x80 local inp = helpers.nvim('replace_termcodes', ':let x2="…"', true, true, true) - nvim('feedkeys', inp, '', true) + nvim('feedkeys', inp, '', true) -- escape_csi=true - -- Disabling CSI escaping in feedkeys + -- nvim_feedkeys with CSI escaping disabled inp = helpers.nvim('replace_termcodes', ':let x3="…"', true, true, true) - nvim('feedkeys', inp, '', false) + nvim('feedkeys', inp, '', false) -- escape_csi=false helpers.stop() end -- cgit