mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-patch:partial:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work (#18048)
Problem: With modifyOtherKeys CTRL-^ doesn't work.
Solution: Handle the exception.
828ffd5963
This commit is contained in:
@@ -1590,11 +1590,19 @@ int vgetc(void)
|
|||||||
c = utf_ptr2char(buf);
|
c = utf_ptr2char(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mod_mask & MOD_MASK_CTRL) && (c >= '?' && c <= '_')) {
|
// A modifier was not used for a mapping, apply it to ASCII
|
||||||
c = Ctrl_chr(c);
|
// keys. Shift would already have been applied.
|
||||||
mod_mask &= ~MOD_MASK_CTRL;
|
if (mod_mask & MOD_MASK_CTRL) {
|
||||||
if (c == 0) { // <C-@> is <Nul>
|
if ((c >= '`' && c <= 0x7f) || (c >= '@' && c <= '_')) {
|
||||||
c = K_ZERO;
|
c &= 0x1f;
|
||||||
|
mod_mask &= ~MOD_MASK_CTRL;
|
||||||
|
if (c == 0) {
|
||||||
|
c = K_ZERO;
|
||||||
|
}
|
||||||
|
} else if (c == '6') {
|
||||||
|
// CTRL-6 is equivalent to CTRL-^
|
||||||
|
c = 0x1e;
|
||||||
|
mod_mask &= ~MOD_MASK_CTRL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ local curbuf_contents = helpers.curbuf_contents
|
|||||||
local meths = helpers.meths
|
local meths = helpers.meths
|
||||||
local exec_lua = helpers.exec_lua
|
local exec_lua = helpers.exec_lua
|
||||||
local write_file = helpers.write_file
|
local write_file = helpers.write_file
|
||||||
|
local funcs = helpers.funcs
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
|
|
||||||
before_each(clear)
|
before_each(clear)
|
||||||
@@ -204,6 +205,13 @@ describe('input pairs', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('Ctrl-6 is Ctrl-^ vim-patch:8.1.2333', function()
|
||||||
|
command('split aaa')
|
||||||
|
command('edit bbb')
|
||||||
|
feed('<C-6>')
|
||||||
|
eq('aaa', funcs.bufname())
|
||||||
|
end)
|
||||||
|
|
||||||
describe('input non-printable chars', function()
|
describe('input non-printable chars', function()
|
||||||
after_each(function()
|
after_each(function()
|
||||||
os.remove('Xtest-overwrite')
|
os.remove('Xtest-overwrite')
|
||||||
|
Reference in New Issue
Block a user