From: Eli Zaretskii Date: Wed, 16 Jul 2014 18:39:35 +0000 (+0300) Subject: Fix bug #18036 with infloop in redisplay with huge fringes. X-Git-Tag: emacs-24.3.93~64 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=56968aa61ccf3933dfcd083dd03f4be559a94efd;p=emacs.git Fix bug #18036 with infloop in redisplay with huge fringes. 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index ca31b10fb6a..a664b12fe6e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-07-16 Eli Zaretskii + + * 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 * xdisp.c (decode_mode_spec): Call file-remote-p on the current diff --git a/src/xdisp.c b/src/xdisp.c index 2f0683294fa..263f499dbfa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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);