fix(cmdline): validate 'incsearch' cursor for "cmdline_show" redraw (#34630)

Problem:  "cmdline_show" event may be emitted with an invalid cursor
          position, causing a redraw that will clear the match highlight.
Solution: Mark the cursor position as valid so that a "cmdline_show"
          callback that updates the screen does not clear the match highlight.
This commit is contained in:
luukvbaal
2025-06-24 16:37:51 +02:00
committed by GitHub
parent 25000be845
commit efd0fa55c8
2 changed files with 12 additions and 0 deletions

View File

@@ -556,6 +556,7 @@ static void may_do_incsearch_highlighting(int firstc, int count, incsearch_state
curwin->w_cursor = s->search_start;
} else if (found != 0) {
curwin->w_cursor = end_pos;
curwin->w_valid_cursor = end_pos; // mark as valid for cmdline_show redraw
}
msg_starthere();