mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #17220 from zeertzjq/unget-alt-chord
This commit is contained in:
commit
1ebac3cf4e
@ -1598,8 +1598,9 @@ int vgetc(void)
|
|||||||
if (!no_mapping && KeyTyped && !(State & TERM_FOCUS)
|
if (!no_mapping && KeyTyped && !(State & TERM_FOCUS)
|
||||||
&& (mod_mask == MOD_MASK_ALT || mod_mask == MOD_MASK_META)) {
|
&& (mod_mask == MOD_MASK_ALT || mod_mask == MOD_MASK_META)) {
|
||||||
mod_mask = 0;
|
mod_mask = 0;
|
||||||
ins_char_typebuf(c, 0);
|
int len = ins_char_typebuf(c, 0);
|
||||||
ins_char_typebuf(ESC, 0);
|
(void)ins_char_typebuf(ESC, 0);
|
||||||
|
ungetchars(len + 3); // The ALT/META modifier takes three more bytes
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,4 +104,20 @@ describe('meta-keys #8226 #13042', function()
|
|||||||
eq({ 0, 2, 1, 0, }, funcs.getpos('.'))
|
eq({ 0, 2, 1, 0, }, funcs.getpos('.'))
|
||||||
eq('nt', eval('mode(1)'))
|
eq('nt', eval('mode(1)'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('ALT/META when recording a macro #13235', function()
|
||||||
|
feed('ifoo<CR>bar<CR>baz<Esc>gg0')
|
||||||
|
-- <M-"> is reinterpreted as <Esc>"
|
||||||
|
feed('qrviw"ayC// This is some text: <M-">apq')
|
||||||
|
expect([[
|
||||||
|
// This is some text: foo
|
||||||
|
bar
|
||||||
|
baz]])
|
||||||
|
-- Should not insert an extra double quote when replaying
|
||||||
|
feed('j0@rj0@@')
|
||||||
|
expect([[
|
||||||
|
// This is some text: foo
|
||||||
|
// This is some text: bar
|
||||||
|
// This is some text: baz]])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user