neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit b2e8c0df2062f765a4cf7d96379c5f0f19393dfd
parent 3ecd45ded044c47efa76b74e9e3b720fbe27adc7
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed,  5 Jul 2023 12:06:14 +0800

fix(edit): fix K_EVENT interfering with 'digraph' (#24258)


Diffstat:
Msrc/nvim/edit.c | 4+++-
Mtest/functional/api/vim_spec.lua | 17+++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/nvim/edit.c b/src/nvim/edit.c @@ -610,7 +610,9 @@ static int insert_execute(VimState *state, int key) } } - s->c = do_digraph(s->c); + if (s->c != K_EVENT) { + s->c = do_digraph(s->c); + } if ((s->c == Ctrl_V || s->c == Ctrl_Q) && ctrl_x_mode_cmdline()) { insert_do_complete(s); diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua @@ -1828,6 +1828,23 @@ describe('API', function() feed('<C-D>') expect('a') -- recognized i_0_CTRL-D end) + + it("does not interrupt with 'digraph'", function() + command('set digraph') + feed('i,') + eq(2, eval('1+1')) -- causes K_EVENT key + feed('<BS>') + eq(2, eval('1+1')) -- causes K_EVENT key + feed('.') + expect('…') -- digraph ",." worked + feed('<Esc>') + feed(':,') + eq(2, eval('1+1')) -- causes K_EVENT key + feed('<BS>') + eq(2, eval('1+1')) -- causes K_EVENT key + feed('.') + eq('…', funcs.getcmdline()) -- digraph ",." worked + end) end) describe('nvim_get_context', function()