diff src/move.c @ 14873:a8ed1cb85859 v8.1.0448

patch 8.1.0448: cursorline not removed when using 'cursorbind' commit https://github.com/vim/vim/commit/4a5abbd6138240d109278fe1f0b45489d22f712d Author: Bram Moolenaar <Bram@vim.org> Date: Tue Oct 2 18:26:10 2018 +0200 patch 8.1.0448: cursorline not removed when using 'cursorbind' Problem: Cursorline not removed when using 'cursorbind'. (Justin Keyes) Solution: Store the last cursor line per window. (closes https://github.com/vim/vim/issues/3488)
author Christian Brabandt <cb@256bit.org>
date Tue, 02 Oct 2018 18:30:06 +0200
parents 27b9a84395b5
children 7b2dcca9e0c1
line wrap: on
line diff
--- a/src/move.c
+++ b/src/move.c
@@ -117,12 +117,10 @@ comp_botline(win_T *wp)
 }
 
 #ifdef FEAT_SYN_HL
-static linenr_T	last_cursorline = 0;
-
     void
 reset_cursorline(void)
 {
-    last_cursorline = 0;
+    curwin->w_last_cursorline = 0;
 }
 #endif
 
@@ -150,18 +148,18 @@ redraw_for_cursorline(win_T *wp)
 #ifdef FEAT_SYN_HL
 	if (wp->w_p_cul)
 	{
-	    if (wp->w_redr_type <= VALID && last_cursorline != 0)
+	    if (wp->w_redr_type <= VALID && wp->w_last_cursorline != 0)
 	    {
-		// "last_cursorline" may be set for another window, worst case
-		// we redraw too much.  This is optimized for moving the cursor
-		// around in the same window.
-		redrawWinline(wp, last_cursorline, FALSE);
+		// "w_last_cursorline" may be outdated, worst case we redraw
+		// too much.  This is optimized for moving the cursor around in
+		// the current window.
+		redrawWinline(wp, wp->w_last_cursorline, FALSE);
 		redrawWinline(wp, wp->w_cursor.lnum, FALSE);
 		redraw_win_later(wp, VALID);
 	    }
 	    else
 		redraw_win_later(wp, SOME_VALID);
-	    last_cursorline = wp->w_cursor.lnum;
+	    wp->w_last_cursorline = wp->w_cursor.lnum;
 	}
 #endif
     }