aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2014-07-16 21:39:35 +0300
committerEli Zaretskii2014-07-16 21:39:35 +0300
commit56968aa61ccf3933dfcd083dd03f4be559a94efd (patch)
tree51293e1a9a31932a40a41d17a8c6e51d11e2efd9
parent61dcf9bc85b309e1fa052eb1e76698d4789f7f72 (diff)
downloademacs-56968aa61ccf3933dfcd083dd03f4be559a94efd.tar.gz
emacs-56968aa61ccf3933dfcd083dd03f4be559a94efd.zip
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.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ca31b10fb6a..a664b12fe6e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12014-07-16 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent
4 infinite looping in redisplay when display lines don't have enough
5 space to display even a single character. (Bug#18036)
6
12014-07-13 Eli Zaretskii <eliz@gnu.org> 72014-07-13 Eli Zaretskii <eliz@gnu.org>
2 8
3 * xdisp.c (decode_mode_spec): Call file-remote-p on the current 9 * 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)
9351 9351
9352 /* Estimate how many newlines we must move back. */ 9352 /* Estimate how many newlines we must move back. */
9353 nlines = max (1, dy / default_line_pixel_height (it->w)); 9353 nlines = max (1, dy / default_line_pixel_height (it->w));
9354 if (it->line_wrap == TRUNCATE) 9354 if (it->line_wrap == TRUNCATE || nchars_per_row == 0)
9355 pos_limit = BEGV; 9355 pos_limit = BEGV;
9356 else 9356 else
9357 pos_limit = max (start_pos - nlines * nchars_per_row, BEGV); 9357 pos_limit = max (start_pos - nlines * nchars_per_row, BEGV);
@@ -9606,7 +9606,7 @@ move_it_by_lines (struct it *it, ptrdiff_t dvpos)
9606 /* Go back -DVPOS buffer lines, but no farther than -DVPOS full 9606 /* Go back -DVPOS buffer lines, but no farther than -DVPOS full
9607 screen lines, and reseat the iterator there. */ 9607 screen lines, and reseat the iterator there. */
9608 start_charpos = IT_CHARPOS (*it); 9608 start_charpos = IT_CHARPOS (*it);
9609 if (it->line_wrap == TRUNCATE) 9609 if (it->line_wrap == TRUNCATE || nchars_per_row == 0)
9610 pos_limit = BEGV; 9610 pos_limit = BEGV;
9611 else 9611 else
9612 pos_limit = max (start_charpos + dvpos * nchars_per_row, BEGV); 9612 pos_limit = max (start_charpos + dvpos * nchars_per_row, BEGV);