diff options
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r-- | src/nvim/move.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 9dccca092a..4a2874abeb 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -104,17 +104,23 @@ 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); + 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); } - last_cursorline = wp->w_cursor.lnum; + 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; + } } } |