From ab1ceaaaa90958301f68633e3248ca746f1c719c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 26 Dec 2021 15:23:39 +0800 Subject: fix: do not save K_EVENT as lastc in Insert mode I'm also gonna move some other K_EVENT-related tests to vim_spec.lua --- src/nvim/edit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 5b63ff5648..2e3eec3642 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -643,7 +643,10 @@ static int insert_check(VimState *state) update_curswant(); s->old_topline = curwin->w_topline; s->old_topfill = curwin->w_topfill; - s->lastc = s->c; // remember previous char for CTRL-D + + if (s->c != K_EVENT) { + s->lastc = s->c; // remember previous char for CTRL-D + } // After using CTRL-G U the next cursor key will not break undo. if (dont_sync_undo == kNone) { -- cgit