patch 9.1.1136: Match highlighting marks a buffer region as changed

Problem:  Match highlighting marks a buffer region to be redrawn as if
          its buffer text was changed, unnecessarily invoking syntax code.
Solution: Set the `w_redraw_top/bot` variables instead of the b_mod_* ones
          (Luuk van Baal)

closes: #16697

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Luuk van Baal
2025-02-22 09:19:04 +01:00
committed by Christian Brabandt
parent bf595ae4ac
commit 7bbb0f357e
5 changed files with 23 additions and 39 deletions

View File

@ -3365,9 +3365,21 @@ redrawWinline(
win_T *wp,
linenr_T lnum)
{
if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum)
wp->w_redraw_top = lnum;
if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
wp->w_redraw_bot = lnum;
redraw_win_later(wp, UPD_VALID);
redraw_win_range_later(wp, lnum, lnum);
}
void
redraw_win_range_later(
win_T *wp,
linenr_T first,
linenr_T last)
{
if (last >= wp->w_topline && first < wp->w_botline)
{
if (wp->w_redraw_top == 0 || wp->w_redraw_top > first)
wp->w_redraw_top = first;
if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < last)
wp->w_redraw_bot = last;
redraw_win_later(wp, UPD_VALID);
}
}