From 02e9a402cae7fd477e097e2656d9ff6c397a0f56 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 30 Apr 2022 06:05:57 +0800 Subject: [PATCH 1/2] test: add test for mapping with character containing K_SPECIAL byte --- test/functional/ex_cmds/cmd_map_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/ex_cmds/cmd_map_spec.lua b/test/functional/ex_cmds/cmd_map_spec.lua index dbbfadabd8..42e97757db 100644 --- a/test/functional/ex_cmds/cmd_map_spec.lua +++ b/test/functional/ex_cmds/cmd_map_spec.lua @@ -136,6 +136,12 @@ describe('mappings with ', function() ]]) end) + it('handles character containing K_SPECIAL (0x80) byte correctly', function() + command([[noremap let g:str = '‥']]) + feed('') + eq('‥', eval('g:str')) + end) + it('works in various modes and sees correct `mode()` value', function() -- normal mode feed('') From 1f72e315503fbaa802270bbad0650c73ef39e3e2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 30 Apr 2022 05:58:13 +0800 Subject: [PATCH 2/2] vim-patch:8.2.4845: duplicate code Problem: Duplicate code. Solution: Move code below if/else. (closes vim/vim#10314) https://github.com/vim/vim/commit/590f365f91511c164253c5b5812d4d0fc4a238d6 N/A patches for version.c: vim-patch:8.2.4844: is simplified to Problem: is simplified to . Solution: Do not simplify CTRL if there is also SHIFT. (closes vim/vim#10313) https://github.com/vim/vim/commit/758a8d199988b5b25566b2820db60dc2c9de3e58 vim-patch:8.2.4846: termcodes test fails Problem: Termcodes test fails. Solution: use CTRL-SHIFT-V to insert an unsimplified key. (closes vim/vim#10316) https://github.com/vim/vim/commit/bad8a013c238595aa206690210eb1367fbc878f9 --- src/nvim/state.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/nvim/state.c b/src/nvim/state.c index 056828574f..6f4bab62d1 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -187,22 +187,17 @@ void get_mode(char *buf) if (State & VREPLACE_FLAG) { buf[i++] = 'R'; buf[i++] = 'v'; - if (ins_compl_active()) { - buf[i++] = 'c'; - } else if (ctrl_x_mode_not_defined_yet()) { - buf[i++] = 'x'; - } } else { if (State & REPLACE_FLAG) { buf[i++] = 'R'; } else { buf[i++] = 'i'; } - if (ins_compl_active()) { - buf[i++] = 'c'; - } else if (ctrl_x_mode_not_defined_yet()) { - buf[i++] = 'x'; - } + } + if (ins_compl_active()) { + buf[i++] = 'c'; + } else if (ctrl_x_mode_not_defined_yet()) { + buf[i++] = 'x'; } } else if ((State & CMDLINE) || exmode_active) { buf[i++] = 'c';