mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.4660: cursorcolumn is sometimes not correct
Problem: Cursorcolumn is sometimes not correct. Solution: Recompute the cursor column when entering Insert mode and the cursor is on a character wider than a screen cell.
This commit is contained in:
13
src/edit.c
13
src/edit.c
@@ -293,11 +293,14 @@ edit(
|
||||
conceal_check_cursor_line(cursor_line_was_concealed);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Need to recompute the cursor position, it might move when the cursor is
|
||||
* on a TAB or special character.
|
||||
*/
|
||||
curs_columns(TRUE);
|
||||
// Need to recompute the cursor position, it might move when the cursor
|
||||
// is on a TAB or special character.
|
||||
// ptr2cells() treats a TAB character as double-width.
|
||||
if (ptr2cells(ml_get_cursor()) > 1)
|
||||
{
|
||||
curwin->w_valid &= ~VALID_VIRTCOL;
|
||||
curs_columns(TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable langmap or IME, indicated by 'iminsert'.
|
||||
|
Reference in New Issue
Block a user