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

@@ -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();
}