From: Eli Zaretskii Date: Sat, 24 Jun 2017 09:37:30 +0000 (+0300) Subject: Fix problems with line-number updates in Follow mode X-Git-Tag: emacs-26.0.90~518^2~156^2~33 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b648ac7a2b2e1b77eb59573db59019d5068476c;p=emacs.git Fix problems with line-number updates in Follow mode * src/xdisp.c (redisplay_window): If forced window-start requires to move a window's point, and the window is under relative line-number display, force another round of redisplay to update the relative line numbers. This fixes follow-mode "redisplay" of its window group. * lisp/frame.el: Add display-line-numbers to the list of variables that should trigger redisplay of the current buffer. --- diff --git a/lisp/frame.el b/lisp/frame.el index b7a55169281..8f51afa2a9a 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2434,6 +2434,7 @@ See also `toggle-frame-maximized'." line-prefix wrap-prefix truncate-lines + display-line-numbers bidi-paragraph-direction bidi-display-reordering)) diff --git a/src/xdisp.c b/src/xdisp.c index 39176e0e675..9b5762550d7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -16800,10 +16800,14 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) 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;