Commit 70f4d973 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix bug #11094 with cursor display on display string after invisible text.

 src/xdisp.c (set_cursor_from_row): If the display string appears in
 the buffer at position that is closer to point than the position
 after the display string, display the cursor on the first glyph of
 the display string.  Fixes cursor display when a 'display' text
 property immediately follows invisible text.
parent e5fcdb5e
2012-04-09 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (set_cursor_from_row): If the display string appears in
the buffer at position that is closer to point than the position
after the display string, display the cursor on the first glyph of
the display string. Fixes cursor display when a 'display' text
property immediately follows invisible text. (Bug#11094)
2012-04-09 Paul Eggert <eggert@cs.ucla.edu> 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
composite.c: use 'double' consistently composite.c: use 'double' consistently
......
...@@ -14042,15 +14042,18 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, ...@@ -14042,15 +14042,18 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
|| pos <= tem) || pos <= tem)
{ {
/* If the string from which this glyph came is /* If the string from which this glyph came is
found in the buffer at point, then we've found in the buffer at point, or at position
found the glyph we've been looking for. If that is closer to point than pos_after, then
it comes from an overlay (tem == 0), and it we've found the glyph we've been looking for.
has the `cursor' property on one of its If it comes from an overlay (tem == 0), and
it has the `cursor' property on one of its
glyphs, record that glyph as a candidate for glyphs, record that glyph as a candidate for
displaying the cursor. (As in the displaying the cursor. (As in the
unidirectional version, we will display the unidirectional version, we will display the
cursor on the last candidate we find.) */ cursor on the last candidate we find.) */
if (tem == 0 || tem == pt_old) if (tem == 0
|| tem == pt_old
|| (tem - pt_old > 0 && tem < pos_after))
{ {
/* The glyphs from this string could have /* The glyphs from this string could have
been reordered. Find the one with the been reordered. Find the one with the
...@@ -14088,7 +14091,8 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, ...@@ -14088,7 +14091,8 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
} }
} }
   
if (tem == pt_old) if (tem == pt_old
|| (tem - pt_old > 0 && tem < pos_after))
goto compute_x; goto compute_x;
} }
if (tem) if (tem)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment