vim-patch:8.2.5047: CurSearch highlight is often wrong

Problem:    CurSearch highlight is often wrong.
Solution:   Remember the last highlighted position and redraw when needed.

368137aa52

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2024-06-19 07:42:56 +08:00
parent 14aba67967
commit a2a3e8412e
6 changed files with 54 additions and 2 deletions

View File

@@ -706,6 +706,9 @@ int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char **line, match_T
// group.
if (shl == search_hl && shl->has_cursor) {
shl->attr_cur = win_hl_attr(wp, HLF_LC);
if (shl->attr_cur != shl->attr) {
search_hl_has_cursor_lnum = lnum;
}
} else {
shl->attr_cur = shl->attr;
}