From 4eef5ac453866dae7c03f5432fc8c4dfcda19f54 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 26 Mar 2023 09:24:04 +0800 Subject: vim-patch:9.0.1428: cursor in wrong position when leaving insert mode (#22786) Problem: Cursor in wrong position when leaving insert mode. Solution: Update the w_valid flags. Position the cursor also when not redrawing. (closes vim/vim#12137) https://github.com/vim/vim/commit/c174c2e58c9e24a75b189e01143e6d057b84e96e Co-authored-by: Bram Moolenaar --- src/nvim/edit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/edit.c') diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 7bc71c1477..0983d025e5 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -3457,6 +3457,7 @@ static bool ins_esc(long *count, int cmdchar, bool nomove) } } else { curwin->w_cursor.col--; + curwin->w_valid &= ~(VALID_WCOL|VALID_VIRTCOL); // Correct cursor for multi-byte character. mb_adjust_cursor(); } -- cgit