diff options
| author | Eli Zaretskii | 2012-09-12 20:12:10 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-09-12 20:12:10 +0300 |
| commit | aa36e4d28b7a405fa542d9fa1dbbfd9758980f22 (patch) | |
| tree | ed20d28cd4dfbc86caf7c0503a0c831c95932331 | |
| parent | e0453b552e68fc2c05cb78cec6103511660c7531 (diff) | |
| download | emacs-aa36e4d28b7a405fa542d9fa1dbbfd9758980f22.tar.gz emacs-aa36e4d28b7a405fa542d9fa1dbbfd9758980f22.zip | |
Fix bug #12403 with garbled display under non-zero scroll-margin.
src/xdisp.c (try_window_reusing_current_matrix): Under bidi
reordering, locate the cursor by calling set_cursor_from_row; if
that fails, clear the desired glyph matrix before returning a
failure indication to the caller. Fixes leaving garbled display
when fast scrolling with a down-key when scroll-margin is non-zero.
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/xdisp.c | 41 |
2 files changed, 31 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 49c1fa345bb..39bdd191188 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-09-12 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (try_window_reusing_current_matrix): Under bidi | ||
| 4 | reordering, locate the cursor by calling set_cursor_from_row; if | ||
| 5 | that fails, clear the desired glyph matrix before returning a | ||
| 6 | failure indication to the caller. Fixes leaving garbled display | ||
| 7 | when fast scrolling with a down-key. (Bug#12403) | ||
| 8 | |||
| 1 | 2012-09-12 Jan Djärv <jan.h.d@swipnet.se> | 9 | 2012-09-12 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 10 | ||
| 3 | * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it | 11 | * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it |
diff --git a/src/xdisp.c b/src/xdisp.c index 6762bf85eb4..3fab4b54cf0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -16593,28 +16593,33 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 16593 | } | 16593 | } |
| 16594 | if (row < bottom_row) | 16594 | if (row < bottom_row) |
| 16595 | { | 16595 | { |
| 16596 | struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos; | 16596 | /* Can't simply scan the row for point with |
| 16597 | struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA]; | 16597 | bidi-reordered glyph rows. Let set_cursor_from_row |
| 16598 | 16598 | figure out where to put the cursor, and if it fails, | |
| 16599 | /* Can't use this optimization with bidi-reordered glyph | 16599 | give up. */ |
| 16600 | rows, unless cursor is already at point. */ | ||
| 16601 | if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) | 16600 | if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) |
| 16602 | { | 16601 | { |
| 16603 | if (!(w->cursor.hpos >= 0 | 16602 | if (!set_cursor_from_row (w, row, w->current_matrix, |
| 16604 | && w->cursor.hpos < row->used[TEXT_AREA] | 16603 | 0, 0, 0, 0)) |
| 16605 | && BUFFERP (glyph->object) | 16604 | { |
| 16606 | && glyph->charpos == PT)) | 16605 | clear_glyph_matrix (w->desired_matrix); |
| 16607 | return 0; | 16606 | return 0; |
| 16607 | } | ||
| 16608 | } | 16608 | } |
| 16609 | else | 16609 | else |
| 16610 | for (; glyph < end | 16610 | { |
| 16611 | && (!BUFFERP (glyph->object) | 16611 | struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos; |
| 16612 | || glyph->charpos < PT); | 16612 | struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA]; |
| 16613 | glyph++) | 16613 | |
| 16614 | { | 16614 | for (; glyph < end |
| 16615 | w->cursor.hpos++; | 16615 | && (!BUFFERP (glyph->object) |
| 16616 | w->cursor.x += glyph->pixel_width; | 16616 | || glyph->charpos < PT); |
| 16617 | } | 16617 | glyph++) |
| 16618 | { | ||
| 16619 | w->cursor.hpos++; | ||
| 16620 | w->cursor.x += glyph->pixel_width; | ||
| 16621 | } | ||
| 16622 | } | ||
| 16618 | } | 16623 | } |
| 16619 | } | 16624 | } |
| 16620 | 16625 | ||