diff options
| author | Eli Zaretskii | 2011-05-28 14:05:40 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-05-28 14:05:40 +0300 |
| commit | c40e2fb22c6f1e21b63209574b75daaee853123f (patch) | |
| tree | 8cc3ea8ef4acc76b1b7ee86f163d4bcdbb83dd67 /src | |
| parent | 5e9c7958cdbc61e633331386aad7d7bcb13b0dea (diff) | |
| download | emacs-c40e2fb22c6f1e21b63209574b75daaee853123f.tar.gz emacs-c40e2fb22c6f1e21b63209574b75daaee853123f.zip | |
Fix cursor motion near overlays covering reordered text.
src/xdisp.c (set_cursor_from_row): Set start and stop points of the
loop that looks for the glyph on which to display cursor according
to the row's direction.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 23 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f7807b90941..b651856f276 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-05-28 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Set start and stop points of the | ||
| 4 | loop that looks for the glyph on which to display cursor according | ||
| 5 | to the row's direction. | ||
| 6 | |||
| 1 | 2011-05-21 Eli Zaretskii <eliz@gnu.org> | 7 | 2011-05-21 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * xdisp.c (handle_display_spec): New function, refactored from the | 9 | * xdisp.c (handle_display_spec): New function, refactored from the |
diff --git a/src/xdisp.c b/src/xdisp.c index dfeb3448525..9d5ec9f1f60 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12818,11 +12818,30 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 12818 | GLYPH_BEFORE and GLYPH_AFTER, and it came from a string | 12818 | GLYPH_BEFORE and GLYPH_AFTER, and it came from a string |
| 12819 | positioned between POS_BEFORE and POS_AFTER in the | 12819 | positioned between POS_BEFORE and POS_AFTER in the |
| 12820 | buffer. */ | 12820 | buffer. */ |
| 12821 | struct glyph *stop = glyph_after; | 12821 | struct glyph *start, *stop; |
| 12822 | EMACS_INT pos = pos_before; | 12822 | EMACS_INT pos = pos_before; |
| 12823 | 12823 | ||
| 12824 | x = -1; | 12824 | x = -1; |
| 12825 | for (glyph = glyph_before + incr; | 12825 | |
| 12826 | /* GLYPH_BEFORE and GLYPH_AFTER are the glyphs that | ||
| 12827 | correspond to POS_BEFORE and POS_AFTER, respectively. We | ||
| 12828 | need START and STOP in the order that corresponds to the | ||
| 12829 | row's direction as given by its reversed_p flag. If the | ||
| 12830 | directionality of characters between POS_BEFORE and | ||
| 12831 | POS_AFTER is the opposite of the row's base direction, | ||
| 12832 | these characters will have been reordered for display, | ||
| 12833 | and we need to reverse START and STOP. */ | ||
| 12834 | if (!row->reversed_p) | ||
| 12835 | { | ||
| 12836 | start = min (glyph_before, glyph_after); | ||
| 12837 | stop = max (glyph_before, glyph_after); | ||
| 12838 | } | ||
| 12839 | else | ||
| 12840 | { | ||
| 12841 | start = max (glyph_before, glyph_after); | ||
| 12842 | stop = min (glyph_before, glyph_after); | ||
| 12843 | } | ||
| 12844 | for (glyph = start + incr; | ||
| 12826 | row->reversed_p ? glyph > stop : glyph < stop; ) | 12845 | row->reversed_p ? glyph > stop : glyph < stop; ) |
| 12827 | { | 12846 | { |
| 12828 | 12847 | ||