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);