aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/edit.c4
-rw-r--r--test/functional/api/vim_spec.lua17
2 files changed, 20 insertions, 1 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 7b605aa970..e44c49ad0b 100644
--- 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
index 664cd4cbca..6f75de7f1b 100644
--- 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()