diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 6ca115087c3..2142d771e2d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -21957,9 +21957,24 @@ display_line (struct it *it, int cursor_vpos) | |||
| 21957 | break; | 21957 | break; |
| 21958 | } | 21958 | } |
| 21959 | 21959 | ||
| 21960 | /* Detect overly-wide wrap-prefixes made of (space ...) display | ||
| 21961 | properties. When such a wrap prefix reaches past the right | ||
| 21962 | margin of the window, we need to avoid the call to | ||
| 21963 | set_iterator_to_next below, so that it->line_wrap is left at | ||
| 21964 | its TRUNCATE value wisely set by handle_line_prefix. | ||
| 21965 | Otherwise, set_iterator_to_next will pop the iterator stack, | ||
| 21966 | restore it->line_wrap, and redisplay might infloop. */ | ||
| 21967 | bool overwide_wrap_prefix = | ||
| 21968 | CONSP (it->object) && EQ (XCAR (it->object), Qspace) | ||
| 21969 | && it->sp > 0 && it->method == GET_FROM_STRETCH | ||
| 21970 | && it->current_x >= it->last_visible_x | ||
| 21971 | && it->continuation_lines_width > 0 | ||
| 21972 | && it->line_wrap == TRUNCATE && it->stack[0].line_wrap != TRUNCATE; | ||
| 21973 | |||
| 21960 | /* Proceed with next display element. Note that this skips | 21974 | /* Proceed with next display element. Note that this skips |
| 21961 | over lines invisible because of selective display. */ | 21975 | over lines invisible because of selective display. */ |
| 21962 | set_iterator_to_next (it, true); | 21976 | if (!overwide_wrap_prefix) |
| 21977 | set_iterator_to_next (it, true); | ||
| 21963 | 21978 | ||
| 21964 | /* If we truncate lines, we are done when the last displayed | 21979 | /* If we truncate lines, we are done when the last displayed |
| 21965 | glyphs reach past the right margin of the window. */ | 21980 | glyphs reach past the right margin of the window. */ |