mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user