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
This commit is contained in:
zeertzjq
2021-12-26 15:23:39 +08:00
parent 9dd8557921
commit ab1ceaaaa9
4 changed files with 40 additions and 43 deletions

View File

@@ -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) {