]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #18036 with infloop in redisplay with huge fringes.
authorEli Zaretskii <eliz@gnu.org>
Wed, 16 Jul 2014 18:39:35 +0000 (21:39 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 16 Jul 2014 18:39:35 +0000 (21:39 +0300)
 src/xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent
 infinite looping in redisplay when display lines don't have enough
 space to display even a single character.

src/ChangeLog
src/xdisp.c

index ca31b10fb6ade4bd4814faf357253d73c19950e0..a664b12fe6e1db08263cb2d655415bf12890fb20 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-16  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent
+       infinite looping in redisplay when display lines don't have enough
+       space to display even a single character.  (Bug#18036)
+
 2014-07-13  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (decode_mode_spec): Call file-remote-p on the current
index 2f0683294faf091b2a356b60e5052428c3f3686b..263f499dbfa7e8b805bcdaf4e88b462ecba62721 100644 (file)
@@ -9351,7 +9351,7 @@ move_it_vertically_backward (struct it *it, int dy)
 
   /* Estimate how many newlines we must move back.  */
   nlines = max (1, dy / default_line_pixel_height (it->w));
-  if (it->line_wrap == TRUNCATE)
+  if (it->line_wrap == TRUNCATE || nchars_per_row == 0)
     pos_limit = BEGV;
   else
     pos_limit = max (start_pos - nlines * nchars_per_row, BEGV);
@@ -9606,7 +9606,7 @@ move_it_by_lines (struct it *it, ptrdiff_t dvpos)
       /* Go back -DVPOS buffer lines, but no farther than -DVPOS full
         screen lines, and reseat the iterator there.  */
       start_charpos = IT_CHARPOS (*it);
-      if (it->line_wrap == TRUNCATE)
+      if (it->line_wrap == TRUNCATE || nchars_per_row == 0)
        pos_limit = BEGV;
       else
        pos_limit = max (start_charpos + dvpos * nchars_per_row, BEGV);