diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-31 13:22:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-31 13:22:32 +0100 |
commit | bbb5f8d4c2cbc5f48556008875f57cbe7fc4ac6c (patch) | |
tree | 1de474becdefcd656f653269ee79b916feb7b98b | |
parent | af703585a34aa30bb5bdf8c05e4be8b3c66f787a (diff) |
patch 8.1.0856: when scrolling a window the cursorline is not always updatedv8.1.0856
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.
-rw-r--r-- | src/move.c | 4 | ||||
-rw-r--r-- | src/normal.c | 4 | ||||
-rw-r--r-- | src/proto/move.pro | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/move.c b/src/move.c index 404b2350fd..14b7a6e7dc 100644 --- a/src/move.c +++ b/src/move.c @@ -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 } diff --git a/src/normal.c b/src/normal.c index b953b7dc4c..b512b559ad 100644 --- a/src/normal.c +++ b/src/normal.c @@ -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; diff --git a/src/proto/move.pro b/src/proto/move.pro index f66e9cd183..ed45c4dc1e 100644 --- a/src/proto/move.pro +++ b/src/proto/move.pro @@ -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); diff --git a/src/version.c b/src/version.c index 4080d5ece8..c0a239c24f 100644 --- a/src/version.c +++ b/src/version.c @@ -784,6 +784,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 856, +/**/ 855, /**/ 854, |