aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-07-05 19:28:34 +0300
committerEli Zaretskii2012-07-05 19:28:34 +0300
commit6dd5a677dbf794eedaa8325c46d57ac041373361 (patch)
tree9e264af8f4ed73fe7cf65a8290c28f3a1cd53806 /src
parent6b312f0fec9becd1ce97f55d5707e79586f954eb (diff)
downloademacs-6dd5a677dbf794eedaa8325c46d57ac041373361.tar.gz
emacs-6dd5a677dbf794eedaa8325c46d57ac041373361.zip
Avoid long futile looping on a TTY under huge values of hscroll.
src/xdisp.c (display_line): Fix horizontal pixel coordinates when hscroll is larger than the line width. Fixes long and futile looping inside extend_face_to_end_of_line (on a TTY) producing glyphs that are not needed and thrown away.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/xdisp.c17
2 files changed, 22 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a2cfd3029f3..1fdeee52f7f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-07-05 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4 hscroll is larger than the line width. Fixes long and futile
5 looping inside extend_face_to_end_of_line (on a TTY) producing
6 glyphs that are not needed and thrown away.
7
12012-07-05 Dmitry Antipov <dmantipov@yandex.ru> 82012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
2 9
3 * marker.c (set_marker_restricted_both): Simplify by using 10 * marker.c (set_marker_restricted_both): Simplify by using
diff --git a/src/xdisp.c b/src/xdisp.c
index d24c05172b6..0c210198fc5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19177,9 +19177,22 @@ display_line (struct it *it)
19177 if the first glyph is partially visible or if we hit a line end. */ 19177 if the first glyph is partially visible or if we hit a line end. */
19178 if (it->current_x < it->first_visible_x) 19178 if (it->current_x < it->first_visible_x)
19179 { 19179 {
19180 enum move_it_result move_result;
19181
19180 this_line_min_pos = row->start.pos; 19182 this_line_min_pos = row->start.pos;
19181 move_it_in_display_line_to (it, ZV, it->first_visible_x, 19183 move_result = move_it_in_display_line_to (it, ZV, it->first_visible_x,
19182 MOVE_TO_POS | MOVE_TO_X); 19184 MOVE_TO_POS | MOVE_TO_X);
19185 /* If we are under a large hscroll, move_it_in_display_line_to
19186 could hit the end of the line without reaching
19187 it->first_visible_x. Pretend that we did reach it. This is
19188 especially important on a TTY, where we will call
19189 extend_face_to_end_of_line, which needs to know how many
19190 blank glyphs to produce. */
19191 if (it->current_x < it->first_visible_x
19192 && (move_result == MOVE_NEWLINE_OR_CR
19193 || move_result == MOVE_POS_MATCH_OR_ZV))
19194 it->current_x = it->first_visible_x;
19195
19183 /* Record the smallest positions seen while we moved over 19196 /* Record the smallest positions seen while we moved over
19184 display elements that are not visible. This is needed by 19197 display elements that are not visible. This is needed by
19185 redisplay_internal for optimizing the case where the cursor 19198 redisplay_internal for optimizing the case where the cursor