XBUFFER (w->contents)->text->redisplay = false;
safe__call1 (true, Vpre_redisplay_function, Fcons (window, Qnil));
- if (w->redisplay || XBUFFER (w->contents)->text->redisplay)
- {
- /* pre-redisplay-function made changes (e.g. move the region)
- that require another round of redisplay. */
+ if (w->redisplay || XBUFFER (w->contents)->text->redisplay
+ || (EQ (Vdisplay_line_numbers, Qrelative)
+ && row != MATRIX_FIRST_TEXT_ROW (w->desired_matrix)))
+ {
+ /* Either pre-redisplay-function made changes (e.g. move
+ the region), or we moved point in a window that is
+ under display-line-numbers = relative mode. We need
+ another round of redisplay. */
clear_glyph_matrix (w->desired_matrix);
if (!try_window (window, startp, 0))
goto need_larger_matrices;