diff options
| author | Eli Zaretskii | 2010-11-19 18:34:22 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2010-11-19 18:34:22 +0200 |
| commit | f48fe1f074f1f9d263fef6b69b8b0780a9de126f (patch) | |
| tree | f808c453d722073b547ec1152331a035fc78e4c2 | |
| parent | 68a1690558e715a73ab21e8eb72236159c4d2df2 (diff) | |
| download | emacs-f48fe1f074f1f9d263fef6b69b8b0780a9de126f.tar.gz emacs-f48fe1f074f1f9d263fef6b69b8b0780a9de126f.zip | |
Fix bug #6687 with cursor positioning after before-string from overlays.
xdisp.c (set_cursor_from_row): Display cursor after all the
glyphs that come from an overlay. Don't overstep the last glyph
when skipping glyphs from an overlay.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9c113a35a77..21e74725dc0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-11-19 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Display cursor after all the | ||
| 4 | glyphs that come from an overlay. Don't overstep the last glyph | ||
| 5 | when skipping glyphs from an overlay. (Bug#6687) | ||
| 6 | |||
| 1 | 2010-11-18 Dan Nicolaescu <dann@ics.uci.edu> | 7 | 2010-11-18 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 8 | ||
| 3 | * alloc.c (refill_memory_reserve): Move declaration ... | 9 | * alloc.c (refill_memory_reserve): Move declaration ... |
diff --git a/src/xdisp.c b/src/xdisp.c index e02abf6a5b5..b2d81cb60e9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12941,7 +12941,8 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 12941 | cursor on that character's glyph. */ | 12941 | cursor on that character's glyph. */ |
| 12942 | EMACS_INT strpos = glyph->charpos; | 12942 | EMACS_INT strpos = glyph->charpos; |
| 12943 | 12943 | ||
| 12944 | cursor = glyph; | 12944 | if (tem) |
| 12945 | cursor = glyph; | ||
| 12945 | for (glyph += incr; | 12946 | for (glyph += incr; |
| 12946 | (row->reversed_p ? glyph > stop : glyph < stop) | 12947 | (row->reversed_p ? glyph > stop : glyph < stop) |
| 12947 | && EQ (glyph->object, str); | 12948 | && EQ (glyph->object, str); |
| @@ -12958,7 +12959,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 12958 | cursor = glyph; | 12959 | cursor = glyph; |
| 12959 | break; | 12960 | break; |
| 12960 | } | 12961 | } |
| 12961 | if (glyph->charpos < strpos) | 12962 | if (tem && glyph->charpos < strpos) |
| 12962 | { | 12963 | { |
| 12963 | strpos = glyph->charpos; | 12964 | strpos = glyph->charpos; |
| 12964 | cursor = glyph; | 12965 | cursor = glyph; |
| @@ -12973,10 +12974,9 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 12973 | } | 12974 | } |
| 12974 | /* This string is not what we want; skip all of the | 12975 | /* This string is not what we want; skip all of the |
| 12975 | glyphs that came from it. */ | 12976 | glyphs that came from it. */ |
| 12976 | do | ||
| 12977 | glyph += incr; | ||
| 12978 | while ((row->reversed_p ? glyph > stop : glyph < stop) | 12977 | while ((row->reversed_p ? glyph > stop : glyph < stop) |
| 12979 | && EQ (glyph->object, str)); | 12978 | && EQ (glyph->object, str)) |
| 12979 | glyph += incr; | ||
| 12980 | } | 12980 | } |
| 12981 | else | 12981 | else |
| 12982 | glyph += incr; | 12982 | glyph += incr; |