set_topline(wp, wp->w_topline);
#endif
// Relative numbering may require updating more.
- if (wp->w_p_rnu)
+ if (wp->w_p_rnu && xtra != 0)
redraw_win_later(wp, SOME_VALID);
#ifdef FEAT_SYN_HL
// Cursor line highlighting probably need to be updated with
}
else
{
- if (wp->w_p_rnu)
+ if (wp->w_p_rnu && wp->w_last_cursor_lnum_rnu != wp->w_cursor.lnum)
{
#ifdef FEAT_FOLDING
- // 'relativenumber' set: The text doesn't need to be drawn, but
- // the number column nearly always does.
+ // 'relativenumber' set and the cursor moved vertically: The
+ // text doesn't need to be drawn, but the number column does.
fold_count = foldedCount(wp, lnum, &win_foldinfo);
if (fold_count != 0)
fold_line(wp, fold_count, &win_foldinfo, lnum, row);
// update w_last_cursorline.
wp->w_last_cursorline = wp->w_p_cul ? wp->w_cursor.lnum : 0;
#endif
+ wp->w_last_cursor_lnum_rnu = wp->w_p_rnu ? wp->w_cursor.lnum : 0;
#ifdef FEAT_VTP
// Rewrite the character at the end of the screen line.
colnr_T w_old_visual_col; // last known start of visual part
colnr_T w_old_curswant; // last known value of Curswant
+ linenr_T w_last_cursor_lnum_rnu; // cursor lnum when 'rnu' was last
+ // redrawn
+
lcs_chars_T w_lcs_chars; // 'listchars' characters
/*