aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r--src/nvim/move.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index be7a8f43ec..4a2874abeb 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -104,16 +104,22 @@ static void redraw_for_cursorline(win_T *wp)
if ((wp->w_p_rnu || wp->w_p_cul)
&& (wp->w_valid & VALID_CROW) == 0
&& !pum_visible()) {
- if (!wp->w_p_rnu && wp->w_redr_type <= VALID && last_cursorline != 0) {
- // "last_cursorline" may be set for another window, worst case we
- // redraw too much. This is optimized for moving the cursor around
- // in the same window.
- redrawWinline(wp, last_cursorline, false);
- redrawWinline(wp, wp->w_cursor.lnum, false);
- last_cursorline = wp->w_cursor.lnum;
+ if (wp->w_p_rnu) {
+ // win_line() will redraw the number column only.
redraw_win_later(wp, VALID);
- } else {
- redraw_win_later(wp, SOME_VALID);
+ }
+ if (wp->w_p_cul) {
+ if (wp->w_redr_type <= VALID && last_cursorline != 0) {
+ // "last_cursorline" may be set for another window, worst case
+ // we redraw too much. This is optimized for moving the cursor
+ // around in the same window.
+ redrawWinline(wp, last_cursorline, false);
+ redrawWinline(wp, wp->w_cursor.lnum, false);
+ redraw_win_later(wp, VALID);
+ } else {
+ redraw_win_later(wp, SOME_VALID);
+ }
+ last_cursorline = wp->w_cursor.lnum;
}
}
}