diff options
| author | Eli Zaretskii | 2010-04-01 15:37:28 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-01 15:37:28 +0300 |
| commit | 814062c76646a9dd4504ae578d7fb41891a5cab4 (patch) | |
| tree | 5ddbe64530dfeb9dd7f8a460a606660f2559409b /src | |
| parent | 357e2d8ec0360a96f48a263487d92754b4144ed3 (diff) | |
| download | emacs-814062c76646a9dd4504ae578d7fb41891a5cab4.tar.gz emacs-814062c76646a9dd4504ae578d7fb41891a5cab4.zip | |
Fix bug #5816.
xdisp.c (set_cursor_from_row): Fix cursor positioning when the
string with `cursor' property comes from an `after-string' overlay.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 19 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a2abfab3727..df0453a341b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-04-01 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Fix cursor positioning when the | ||
| 4 | string with `cursor' property comes from an `after-string' | ||
| 5 | overlay. (Bug#5816) | ||
| 6 | |||
| 1 | 2010-04-01 Glenn Morris <rgm@gnu.org> | 7 | 2010-04-01 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * Makefile.in (LIBTIFF, LIBJPEG, LIBPNG, LIBGIF, LIBXPM, XFT_LIBS): | 9 | * Makefile.in (LIBTIFF, LIBJPEG, LIBPNG, LIBGIF, LIBXPM, XFT_LIBS): |
diff --git a/src/xdisp.c b/src/xdisp.c index 709ff5f6d68..c6ae6ad4c14 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12823,12 +12823,19 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12823 | 12823 | ||
| 12824 | str = glyph->object; | 12824 | str = glyph->object; |
| 12825 | tem = string_buffer_position_lim (w, str, pos, pos_after, 0); | 12825 | tem = string_buffer_position_lim (w, str, pos, pos_after, 0); |
| 12826 | if (pos <= tem) | 12826 | if (tem == 0 /* from overlay */ |
| 12827 | || pos <= tem) | ||
| 12827 | { | 12828 | { |
| 12828 | /* If the string from which this glyph came is | 12829 | /* If the string from which this glyph came is |
| 12829 | found in the buffer at point, then we've | 12830 | found in the buffer at point, then we've |
| 12830 | found the glyph we've been looking for. */ | 12831 | found the glyph we've been looking for. If |
| 12831 | if (tem == pt_old) | 12832 | it comes from an overlay (tem == 0), and it |
| 12833 | has the `cursor' property on one of its | ||
| 12834 | glyphs, record that glyph as a candidate for | ||
| 12835 | displaying the cursor. (As in the | ||
| 12836 | unidirectional version, we will display the | ||
| 12837 | cursor on the last candidate we find.) */ | ||
| 12838 | if (tem == 0 || tem == pt_old) | ||
| 12832 | { | 12839 | { |
| 12833 | /* The glyphs from this string could have | 12840 | /* The glyphs from this string could have |
| 12834 | been reordered. Find the one with the | 12841 | been reordered. Find the one with the |
| @@ -12861,9 +12868,11 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12861 | } | 12868 | } |
| 12862 | } | 12869 | } |
| 12863 | 12870 | ||
| 12864 | goto compute_x; | 12871 | if (tem == pt_old) |
| 12872 | goto compute_x; | ||
| 12865 | } | 12873 | } |
| 12866 | pos = tem + 1; /* don't find previous instances */ | 12874 | if (tem) |
| 12875 | pos = tem + 1; /* don't find previous instances */ | ||
| 12867 | } | 12876 | } |
| 12868 | /* This string is not what we want; skip all of the | 12877 | /* This string is not what we want; skip all of the |
| 12869 | glyphs that came from it. */ | 12878 | glyphs that came from it. */ |