vim-patch:9.1.1836: 'culopt' "screenline" not redrawn with line("w0") and :retab

Problem:  'cursorlineopt' "screenline" isn't redrawn when moving cursor
          and then using line("w0") and :retab that does nothing.
Solution: Call redraw_for_cursorcolumn() when setting a valid w_virtcol
          (zeertzjq).

closes: vim/vim#18506

a084914361
(cherry picked from commit ba47cb7eda)
This commit is contained in:
zeertzjq
2025-10-08 06:51:15 +08:00
committed by github-actions[bot]
parent e1fe0ed2df
commit d21c23b8c9
6 changed files with 70 additions and 25 deletions

View File

@@ -64,8 +64,7 @@ int coladvance_force(colnr_T wcol)
curwin->w_valid &= ~VALID_VIRTCOL;
} else {
// Virtcol is valid
curwin->w_valid |= VALID_VIRTCOL;
curwin->w_virtcol = wcol;
set_valid_virtcol(curwin, wcol);
}
return rc;
}
@@ -85,8 +84,7 @@ int coladvance(win_T *wp, colnr_T wcol)
wp->w_valid &= ~VALID_VIRTCOL;
} else if (*(ml_get_buf(wp->w_buffer, wp->w_cursor.lnum) + wp->w_cursor.col) != TAB) {
// Virtcol is valid when not on a TAB
wp->w_valid |= VALID_VIRTCOL;
wp->w_virtcol = wcol;
set_valid_virtcol(curwin, wcol);
}
return rc;
}