0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'

Problem:    Superfluous check if a redraw is needed for 'cursorline'.
Solution:   Remove check_redraw_cursorline(). (closes #10030, closes #10029)
This commit is contained in:
zeertzjq
2022-03-27 19:26:55 +01:00
committed by Bram Moolenaar
parent 565d1278cb
commit 3e559cd884
11 changed files with 94 additions and 41 deletions

View File

@@ -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)