aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-07-08 17:33:43 +0200
committerGitHub <noreply@github.com>2017-07-08 17:33:43 +0200
commit0fb4d173f8faa7ec4736ceb3b4e89ada6f7d73e5 (patch)
tree93bb22888e979af1e86dba6c419a441f44e67f42 /test/functional/api
parent6720fe253e92b21c7f989389a64e363b5933884f (diff)
parent829e1f2c43f84caa74c68e8a473d5faf8ec96c48 (diff)
downloadrneovim-0fb4d173f8faa7ec4736ceb3b4e89ada6f7d73e5.tar.gz
rneovim-0fb4d173f8faa7ec4736ceb3b4e89ada6f7d73e5.tar.bz2
rneovim-0fb4d173f8faa7ec4736ceb3b4e89ada6f7d73e5.zip
Merge #6945 from justinmk/cpoptions
Diffstat (limited to 'test/functional/api')
-rw-r--r--test/functional/api/keymap_spec.lua18
-rw-r--r--test/functional/api/vim_spec.lua13
2 files changed, 17 insertions, 14 deletions
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-a><LT>C-a>\\ \\<C-b><C-b><LT>C-b>\\')
command('nnoremap <special> \\<C-c><C-c><LT>C-c>\\ \\<C-d><C-d><LT>C-d>\\')
- command('set cpo+=B<')
+ command('set cpo+=B')
command('xnoremap \\<C-a><C-a><LT>C-a>\\ \\<C-b><C-b><LT>C-b>\\')
command('xnoremap <special> \\<C-c><C-c><LT>C-c>\\ \\<C-d><C-d><LT>C-d>\\')
- command('set cpo-=B<')
+ command('set cpo-=B')
command('snoremap \\<C-a><C-a><LT>C-a>\\ \\<C-b><C-b><LT>C-b>\\')
command('snoremap <special> \\<C-c><C-c><LT>C-c>\\ \\<C-d><C-d><LT>C-d>\\')
- command('set cpo-=B cpo+=<')
+ command('set cpo-=B')
command('onoremap \\<C-a><C-a><LT>C-a>\\ \\<C-b><C-b><LT>C-b>\\')
command('onoremap <special> \\<C-c><C-c><LT>C-c>\\ \\<C-d><C-d><LT>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-C><lt>C-c>\\', '\\<C-D><C-D><lt>C-d>\\', 'n'),
cpomap('\\<C-A><C-A><lt>C-a>\\', '\\<C-B><C-B><lt>C-b>\\', 'n')},
meths.get_keymap('n'))
eq({cpomap('\\<C-C><C-C><lt>C-c>\\', '\\<C-D><C-D><lt>C-d>\\', 'x'),
- cpomap('\\<lt>C-a><lt>C-a><lt>LT>C-a>\\', '\\<lt>C-b><lt>C-b><lt>LT>C-b>\\', 'x')},
+ cpomap('\\<C-A><C-A><lt>C-a>\\', '\\<C-B><C-B><lt>C-b>\\', 'x')},
meths.get_keymap('x'))
eq({cpomap('<lt>C-c><C-C><lt>C-c> ', '<lt>C-d><C-D><lt>C-d>', 's'),
cpomap('<lt>C-a><C-A><lt>C-a> ', '<lt>C-b><C-B><lt>C-b>', 's')},
meths.get_keymap('s'))
eq({cpomap('<lt>C-c><C-C><lt>C-c> ', '<lt>C-d><C-D><lt>C-d>', 'o'),
- cpomap('<lt>C-a><lt>C-a><lt>LT>C-a> ', '<lt>C-b><lt>C-b><lt>LT>C-b>', 'o')},
+ cpomap('<lt>C-a><C-A><lt>C-a> ', '<lt>C-b><C-B><lt>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()
'<NL>x<Esc>x<CR>x<lt>x', true, true, true))
end)
+ it('does not convert keycodes if special=false', function()
+ eq('<NL>x<Esc>x<CR>x<lt>x', helpers.nvim('replace_termcodes',
+ '<NL>x<Esc>x<CR>x<lt>x', 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="…"<CR>', 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="…"<CR>', true, true, true)
- nvim('feedkeys', inp, '', false)
+ nvim('feedkeys', inp, '', false) -- escape_csi=false
helpers.stop()
end