Skip to content

Commit bbb5f8d

Browse files
committed
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.
1 parent af70358 commit bbb5f8d

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/move.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "vim.h"
2121

22-
static void redraw_for_cursorline(win_T *wp);
2322
static int scrolljump_value(void);
2423
static int check_top_offset(void);
2524
static void curs_rows(win_T *wp);
@@ -128,7 +127,7 @@ reset_cursorline(void)
128127
* Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is
129128
* set.
130129
*/
131-
static void
130+
void
132131
redraw_for_cursorline(win_T *wp)
133132
{
134133
if ((wp->w_p_rnu
@@ -158,7 +157,6 @@ redraw_for_cursorline(win_T *wp)
158157
}
159158
else
160159
redraw_win_later(wp, SOME_VALID);
161-
wp->w_last_cursorline = wp->w_cursor.lnum;
162160
}
163161
#endif
164162
}

src/normal.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4587,6 +4587,10 @@ nv_mousescroll(cmdarg_T *cap)
45874587
}
45884588
}
45894589
# endif
4590+
# ifdef FEAT_SYN_HL
4591+
if (curwin != old_curwin && curwin->w_p_cul)
4592+
redraw_for_cursorline(curwin);
4593+
# endif
45904594

45914595
curwin->w_redr_status = TRUE;
45924596

src/proto/move.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* move.c */
22
void reset_cursorline(void);
3+
void redraw_for_cursorline(win_T *wp);
34
void update_topline_redraw(void);
45
void update_topline(void);
56
void update_curswant(void);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,8 @@ static char *(features[]) =
783783

784784
static int included_patches[] =
785785
{ /* Add new patch number below this line */
786+
/**/
787+
856,
786788
/**/
787789
855,
788790
/**/

0 commit comments

Comments
 (0)