perf: only redraw for CurSearch when it is currently in use

The check in redraw_for_cursorline() is not needed because VALID_VIRTCOL
is always cleared when the cursor moves to another line, so the check in
redraw_for_cursorcolumn() is enough.
This commit is contained in:
zeertzjq
2022-04-23 21:21:59 +08:00
parent 933274c438
commit 38ee2a41df
2 changed files with 13 additions and 9 deletions

View File

@@ -6017,3 +6017,9 @@ bool search_was_last_used(void)
{
return last_idx == 0;
}
/// @return true if 'hlsearch' highlight is currently in use.
bool using_hlsearch(void)
{
return spats[last_idx].pat != NULL && p_hls && !no_hlsearch;
}