]> granicus.if.org Git - vim/commitdiff
patch 8.1.0856: when scrolling a window the cursorline is not always updated v8.1.0856
authorBram Moolenaar <Bram@vim.org>
Thu, 31 Jan 2019 12:22:32 +0000 (13:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 31 Jan 2019 12:22:32 +0000 (13:22 +0100)
Problem:    When scrolling a window other than the current one the cursorline
            highlighting is not always updated. (Jason Franklin)
Solution:   Call redraw_for_cursorline() after scrolling.  Only set
            w_last_cursorline when drawing the cursor line.  Reset the lines
            to be redrawn also when redrawing the whole window.

src/move.c
src/normal.c
src/proto/move.pro
src/version.c

index 404b2350fd2f4e051351506f3b76b81560c4aef7..14b7a6e7dc5c66bf3ea0bb0f070cce6ef6a69ea6 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "vim.h"
 
-static void redraw_for_cursorline(win_T *wp);
 static int scrolljump_value(void);
 static int check_top_offset(void);
 static void curs_rows(win_T *wp);
@@ -128,7 +127,7 @@ reset_cursorline(void)
  * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is
  * set.
  */
-    static void
+    void
 redraw_for_cursorline(win_T *wp)
 {
     if ((wp->w_p_rnu
@@ -158,7 +157,6 @@ redraw_for_cursorline(win_T *wp)
            }
            else
                redraw_win_later(wp, SOME_VALID);
-           wp->w_last_cursorline = wp->w_cursor.lnum;
        }
 #endif
     }
index b953b7dc4cb56891085c5a6c5eaac47a955394e3..b512b559ada3beb095f52ad493fa843bfcea63db 100644 (file)
@@ -4587,6 +4587,10 @@ nv_mousescroll(cmdarg_T *cap)
        }
     }
 # endif
+# ifdef FEAT_SYN_HL
+    if (curwin != old_curwin && curwin->w_p_cul)
+       redraw_for_cursorline(curwin);
+# endif
 
     curwin->w_redr_status = TRUE;
 
index f66e9cd18387e97ef6d74e70924fda4cfdbeaef8..ed45c4dc1e97a880b8ba54b6ba907c75bb40062b 100644 (file)
@@ -1,5 +1,6 @@
 /* move.c */
 void reset_cursorline(void);
+void redraw_for_cursorline(win_T *wp);
 void update_topline_redraw(void);
 void update_topline(void);
 void update_curswant(void);
index 4080d5ece8bc57dd7d4aadafb56daa09a5423d70..c0a239c24f51be86e5530b2f282d247a1c71c48a 100644 (file)
@@ -783,6 +783,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    856,
 /**/
     855,
 /**/