emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/line-numbers 5b648ac 04/14: Fix problems with line


From: Eli Zaretskii
Subject: [Emacs-diffs] scratch/line-numbers 5b648ac 04/14: Fix problems with line-number updates in Follow mode
Date: Sat, 24 Jun 2017 13:12:51 -0400 (EDT)

branch: scratch/line-numbers
commit 5b648ac7a2b2e1b77eb59573db59019d5068476c
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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.
---
 lisp/frame.el |  1 +
 src/xdisp.c   | 12 ++++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/frame.el b/lisp/frame.el
index b7a5516..8f51afa 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 39176e0..9b57625 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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]