emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master eff901b: Prevent infloops in redisplay due to trunc


From: Eli Zaretskii
Subject: [Emacs-diffs] master eff901b: Prevent infloops in redisplay due to truncate-lines and overlays
Date: Fri, 23 Dec 2016 14:19:27 +0000 (UTC)

branch: master
commit eff901b8a39f42ddedf4c1db833b9071cae5962f
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Prevent infloops in redisplay due to truncate-lines and overlays
    
    * src/xdisp.c (hscroll_window_tree): Avoid inflooping in
    redisplay_window when a screen line ends in an overlay string with
    a newline.  (Bug#25246)
---
 src/xdisp.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/xdisp.c b/src/xdisp.c
index ad0b968..5de5eca 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13049,6 +13049,17 @@ hscroll_window_tree (Lisp_Object window)
              init_to_row_start (&it, w, cursor_row);
              it.last_visible_x = INFINITY;
              move_it_in_display_line_to (&it, pt, -1, MOVE_TO_POS);
+             /* If the line ends in an overlay string with a newline,
+                we might infloop, because displaying the window will
+                want to put the cursor after the overlay, i.e. at X
+                coordinate of zero on the next screen line.  So we
+                use the buffer position prior to the overlay string
+                instead.  */
+             if (it.method == GET_FROM_STRING && pt > 1)
+               {
+                 init_to_row_start (&it, w, cursor_row);
+                 move_it_in_display_line_to (&it, pt - 1, -1, MOVE_TO_POS);
+               }
              current_buffer = saved_current_buffer;
 
              /* Position cursor in window.  */



reply via email to

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