diff options
Diffstat (limited to 'src/move.c')
-rw-r--r-- | src/move.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/move.c b/src/move.c index 571ec8c31..3d8356fe9 100644 --- a/src/move.c +++ b/src/move.c @@ -135,6 +135,26 @@ redraw_for_cursorline(win_T *wp) } } +#ifdef FEAT_SYN_HL +/* + * Redraw when w_virtcol changes and 'cursorcolumn' is set or 'cursorlineopt' + * contains "screenline". + */ + static void +redraw_for_cursorcolumn(win_T *wp) +{ + if ((wp->w_valid & VALID_VIRTCOL) == 0 && !pum_visible()) + { + // When 'cursorcolumn' is set need to redraw with SOME_VALID. + if (wp->w_p_cuc) + redraw_later(SOME_VALID); + // When 'cursorlineopt' contains "screenline" need to redraw with VALID. + else if (wp->w_p_cul && (wp->w_p_culopt_flags & CULOPT_SCRLINE)) + redraw_later(VALID); + } +} +#endif + /* * Update curwin->w_topline and redraw if necessary. * Used to update the screen before printing a message. @@ -798,11 +818,10 @@ validate_virtcol_win(win_T *wp) if (!(wp->w_valid & VALID_VIRTCOL)) { getvvcol(wp, &wp->w_cursor, NULL, &(wp->w_virtcol), NULL); - wp->w_valid |= VALID_VIRTCOL; #ifdef FEAT_SYN_HL - if (wp->w_p_cuc && !pum_visible()) - redraw_win_later(wp, SOME_VALID); + redraw_for_cursorcolumn(wp); #endif + wp->w_valid |= VALID_VIRTCOL; } } @@ -1169,10 +1188,7 @@ curs_columns( redraw_later(NOT_VALID); #ifdef FEAT_SYN_HL - // Redraw when w_virtcol changes and 'cursorcolumn' is set - if (curwin->w_p_cuc && (curwin->w_valid & VALID_VIRTCOL) == 0 - && !pum_visible()) - redraw_later(SOME_VALID); + redraw_for_cursorcolumn(curwin); #endif #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL) if (popup_is_popup(curwin) && curbuf->b_term != NULL) |