diff src/match.c @ 29050:a2710736125a v8.2.5047

patch 8.2.5047: CurSearch highlight is often wrong Commit: https://github.com/vim/vim/commit/368137aa525982984beed73940af481ac53a62af Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 31 13:43:12 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Tue, 31 May 2022 14:45:03 +0200
parents 3a16a350614f
children b90bca860b5a
line wrap: on
line diff
--- a/src/match.c
+++ b/src/match.c
@@ -798,7 +798,11 @@ update_search_hl(
 		// Highlight the match were the cursor is using the CurSearch
 		// group.
 		if (shl == search_hl && shl->has_cursor)
+		{
 		    shl->attr_cur = HL_ATTR(HLF_LC);
+		    if (shl->attr_cur != shl->attr)
+			search_hl_has_cursor_lnum = lnum;
+		}
 
 	    }
 	    else if (col == shl->endcol)