aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 2142d771e2d..d28c1140678 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9211,9 +9211,25 @@ move_it_in_display_line_to (struct it *it,
9211 prev_method = it->method; 9211 prev_method = it->method;
9212 if (it->method == GET_FROM_BUFFER) 9212 if (it->method == GET_FROM_BUFFER)
9213 prev_pos = IT_CHARPOS (*it); 9213 prev_pos = IT_CHARPOS (*it);
9214
9215 /* Detect overly-wide wrap-prefixes made of (space ...) display
9216 properties. When such a wrap prefix reaches past the right
9217 margin of the window, we need to avoid the call to
9218 set_iterator_to_next below, so that it->line_wrap is left at
9219 its TRUNCATE value wisely set by handle_line_prefix.
9220 Otherwise, set_iterator_to_next will pop the iterator stack,
9221 restore it->line_wrap, and we might miss the opportunity to
9222 exit the loop and return. */
9223 bool overwide_wrap_prefix =
9224 CONSP (it->object) && EQ (XCAR (it->object), Qspace)
9225 && it->sp > 0 && it->method == GET_FROM_STRETCH
9226 && it->current_x >= it->last_visible_x
9227 && it->continuation_lines_width > 0
9228 && it->line_wrap == TRUNCATE && it->stack[0].line_wrap != TRUNCATE;
9214 /* The current display element has been consumed. Advance 9229 /* The current display element has been consumed. Advance
9215 to the next. */ 9230 to the next. */
9216 set_iterator_to_next (it, true); 9231 if (!overwide_wrap_prefix)
9232 set_iterator_to_next (it, true);
9217 if (IT_CHARPOS (*it) < CHARPOS (this_line_min_pos)) 9233 if (IT_CHARPOS (*it) < CHARPOS (this_line_min_pos))
9218 SET_TEXT_POS (this_line_min_pos, IT_CHARPOS (*it), IT_BYTEPOS (*it)); 9234 SET_TEXT_POS (this_line_min_pos, IT_CHARPOS (*it), IT_BYTEPOS (*it));
9219 if (IT_CHARPOS (*it) < to_charpos) 9235 if (IT_CHARPOS (*it) < to_charpos)