diff options
| author | Eli Zaretskii | 2017-07-14 10:53:36 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-07-14 10:53:36 +0300 |
| commit | 6fa3176ccae2bd8dcf082b80063c4e2148f5e8fd (patch) | |
| tree | 8a91551558f19a4298caf1b1ad3ede6aa36bf188 /src | |
| parent | 5c9b6e901ca97895c6224f32f1a9ca4a7d565b65 (diff) | |
| download | emacs-6fa3176ccae2bd8dcf082b80063c4e2148f5e8fd.tar.gz emacs-6fa3176ccae2bd8dcf082b80063c4e2148f5e8fd.zip | |
Prevent display corruption when display-line-numbers is set
* src/xdisp.c (try_window_reusing_current_matrix): If giving up
due to display-line-numbers, clear the window's desired glyph
matrix before returning, as the following call to try_window will
call display_line, which expects rows of the desired matrix
cleared. (Bug#27668)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 6b0532d95f5..85b9eae36d1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -17655,6 +17655,9 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 17655 | if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)) | 17655 | if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)) |
| 17656 | return false; | 17656 | return false; |
| 17657 | 17657 | ||
| 17658 | /* Clear the desired matrix for the display below. */ | ||
| 17659 | clear_glyph_matrix (w->desired_matrix); | ||
| 17660 | |||
| 17658 | /* Give up if line numbers are being displayed, because reusing the | 17661 | /* Give up if line numbers are being displayed, because reusing the |
| 17659 | current matrix might use the wrong width for line-number | 17662 | current matrix might use the wrong width for line-number |
| 17660 | display. */ | 17663 | display. */ |
| @@ -17667,9 +17670,6 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 17667 | start = start_row->minpos; | 17670 | start = start_row->minpos; |
| 17668 | start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix); | 17671 | start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix); |
| 17669 | 17672 | ||
| 17670 | /* Clear the desired matrix for the display below. */ | ||
| 17671 | clear_glyph_matrix (w->desired_matrix); | ||
| 17672 | |||
| 17673 | if (CHARPOS (new_start) <= CHARPOS (start)) | 17673 | if (CHARPOS (new_start) <= CHARPOS (start)) |
| 17674 | { | 17674 | { |
| 17675 | /* Don't use this method if the display starts with an ellipsis | 17675 | /* Don't use this method if the display starts with an ellipsis |