diff options
| author | Eli Zaretskii | 2016-12-23 16:17:52 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-12-23 16:17:52 +0200 |
| commit | eff901b8a39f42ddedf4c1db833b9071cae5962f (patch) | |
| tree | 0dcb20eeeb10b6399ba125f73a6677f38a02e68a /src | |
| parent | 6eaadcc7c821b7a8c75ce6d1d56cd7f50898f809 (diff) | |
| download | emacs-eff901b8a39f42ddedf4c1db833b9071cae5962f.tar.gz emacs-eff901b8a39f42ddedf4c1db833b9071cae5962f.zip | |
Prevent infloops in redisplay due to truncate-lines and overlays
* src/xdisp.c (hscroll_window_tree): Avoid inflooping in
redisplay_window when a screen line ends in an overlay string with
a newline. (Bug#25246)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index ad0b9686f04..5de5ecaef0d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13049,6 +13049,17 @@ hscroll_window_tree (Lisp_Object window) | |||
| 13049 | init_to_row_start (&it, w, cursor_row); | 13049 | init_to_row_start (&it, w, cursor_row); |
| 13050 | it.last_visible_x = INFINITY; | 13050 | it.last_visible_x = INFINITY; |
| 13051 | move_it_in_display_line_to (&it, pt, -1, MOVE_TO_POS); | 13051 | move_it_in_display_line_to (&it, pt, -1, MOVE_TO_POS); |
| 13052 | /* If the line ends in an overlay string with a newline, | ||
| 13053 | we might infloop, because displaying the window will | ||
| 13054 | want to put the cursor after the overlay, i.e. at X | ||
| 13055 | coordinate of zero on the next screen line. So we | ||
| 13056 | use the buffer position prior to the overlay string | ||
| 13057 | instead. */ | ||
| 13058 | if (it.method == GET_FROM_STRING && pt > 1) | ||
| 13059 | { | ||
| 13060 | init_to_row_start (&it, w, cursor_row); | ||
| 13061 | move_it_in_display_line_to (&it, pt - 1, -1, MOVE_TO_POS); | ||
| 13062 | } | ||
| 13052 | current_buffer = saved_current_buffer; | 13063 | current_buffer = saved_current_buffer; |
| 13053 | 13064 | ||
| 13054 | /* Position cursor in window. */ | 13065 | /* Position cursor in window. */ |