0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.0856: when scrolling a window the cursorline is not always updated

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.
This commit is contained in:
Bram Moolenaar
2019-01-31 13:22:32 +01:00
parent af703585a3
commit bbb5f8d4c2
4 changed files with 8 additions and 3 deletions

View File

@@ -19,7 +19,6 @@
#include "vim.h" #include "vim.h"
static void redraw_for_cursorline(win_T *wp);
static int scrolljump_value(void); static int scrolljump_value(void);
static int check_top_offset(void); static int check_top_offset(void);
static void curs_rows(win_T *wp); 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 * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is
* set. * set.
*/ */
static void void
redraw_for_cursorline(win_T *wp) redraw_for_cursorline(win_T *wp)
{ {
if ((wp->w_p_rnu if ((wp->w_p_rnu
@@ -158,7 +157,6 @@ redraw_for_cursorline(win_T *wp)
} }
else else
redraw_win_later(wp, SOME_VALID); redraw_win_later(wp, SOME_VALID);
wp->w_last_cursorline = wp->w_cursor.lnum;
} }
#endif #endif
} }

View File

@@ -4587,6 +4587,10 @@ nv_mousescroll(cmdarg_T *cap)
} }
} }
# endif # endif
# ifdef FEAT_SYN_HL
if (curwin != old_curwin && curwin->w_p_cul)
redraw_for_cursorline(curwin);
# endif
curwin->w_redr_status = TRUE; curwin->w_redr_status = TRUE;

View File

@@ -1,5 +1,6 @@
/* move.c */ /* move.c */
void reset_cursorline(void); void reset_cursorline(void);
void redraw_for_cursorline(win_T *wp);
void update_topline_redraw(void); void update_topline_redraw(void);
void update_topline(void); void update_topline(void);
void update_curswant(void); void update_curswant(void);

View File

@@ -783,6 +783,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
856,
/**/ /**/
855, 855,
/**/ /**/