Mercurial > vim
comparison src/move.c @ 15697:b7a88676e81c v8.1.0856
patch 8.1.0856: when scrolling a window the cursorline is not always updated
commit https://github.com/vim/vim/commit/bbb5f8d4c2cbc5f48556008875f57cbe7fc4ac6c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 31 13:22:32 2019 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 31 Jan 2019 13:30:07 +0100 |
parents | 6f1c7e9a6393 |
children | ad8b2c109b22 |
comparison
equal
deleted
inserted
replaced
15696:2cc75ec8bda2 | 15697:b7a88676e81c |
---|---|
17 * The 'scrolloff' option makes this a bit complicated. | 17 * The 'scrolloff' option makes this a bit complicated. |
18 */ | 18 */ |
19 | 19 |
20 #include "vim.h" | 20 #include "vim.h" |
21 | 21 |
22 static void redraw_for_cursorline(win_T *wp); | |
23 static int scrolljump_value(void); | 22 static int scrolljump_value(void); |
24 static int check_top_offset(void); | 23 static int check_top_offset(void); |
25 static void curs_rows(win_T *wp); | 24 static void curs_rows(win_T *wp); |
26 | 25 |
27 typedef struct | 26 typedef struct |
126 | 125 |
127 /* | 126 /* |
128 * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is | 127 * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is |
129 * set. | 128 * set. |
130 */ | 129 */ |
131 static void | 130 void |
132 redraw_for_cursorline(win_T *wp) | 131 redraw_for_cursorline(win_T *wp) |
133 { | 132 { |
134 if ((wp->w_p_rnu | 133 if ((wp->w_p_rnu |
135 #ifdef FEAT_SYN_HL | 134 #ifdef FEAT_SYN_HL |
136 || wp->w_p_cul | 135 || wp->w_p_cul |
156 redrawWinline(wp, wp->w_last_cursorline); | 155 redrawWinline(wp, wp->w_last_cursorline); |
157 redrawWinline(wp, wp->w_cursor.lnum); | 156 redrawWinline(wp, wp->w_cursor.lnum); |
158 } | 157 } |
159 else | 158 else |
160 redraw_win_later(wp, SOME_VALID); | 159 redraw_win_later(wp, SOME_VALID); |
161 wp->w_last_cursorline = wp->w_cursor.lnum; | |
162 } | 160 } |
163 #endif | 161 #endif |
164 } | 162 } |
165 } | 163 } |
166 | 164 |