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)

c174c2e58c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-03-26 09:24:04 +08:00
committed by GitHub
parent e3dab4b326
commit 4eef5ac453
5 changed files with 102 additions and 11 deletions

View File

@@ -1377,6 +1377,7 @@ static int normal_check(VimState *state)
// update cursor and redraw.
if (skip_redraw || exmode_active) {
skip_redraw = false;
setcursor();
} else if (do_redraw || stuff_empty()) {
// Ensure curwin->w_topline and curwin->w_leftcol are up to date
// before triggering a WinScrolled autocommand.