From: Eli Zaretskii Date: Sat, 17 Sep 2011 08:09:45 +0000 (+0300) Subject: Fix bug #9524 with cursor positioning on display strings in truncated lines. X-Git-Tag: emacs-pretest-24.0.90~104^2~17 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb187662be4ccd53e168fb07501931da596de39a;p=emacs.git Fix bug #9524 with cursor positioning on display strings in truncated lines. src/xdisp.c (set_cursor_from_row): Don't invoke special treatment of truncated lines if point is covered by a display string. --- diff --git a/src/ChangeLog b/src/ChangeLog index 27b7e709317..c6238701301 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-09-17 Eli Zaretskii + + * xdisp.c (set_cursor_from_row): Don't invoke special treatment of + truncated lines if point is covered by a display string. (Bug#9524) + 2011-09-16 Paul Eggert * xselect.c: Relax test for outgoing X longs (Bug#9498). diff --git a/src/xdisp.c b/src/xdisp.c index 6ba92f3ed79..864734d4b20 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13637,15 +13637,17 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, /* A truncated row may not include PT among its character positions. Setting the cursor inside the scroll margin will trigger recalculation of hscroll - in hscroll_window_tree. */ - || (row->truncated_on_left_p && pt_old < bpos_min) - || (row->truncated_on_right_p && pt_old > bpos_max) - /* Zero-width characters produce no glyphs. */ + in hscroll_window_tree. But if a display string + covers point, defer to the string-handling code + below to figure this out. */ || (!string_seen - && !empty_line_p - && (row->reversed_p - ? glyph_after > glyphs_end - : glyph_after < glyphs_end))) + && ((row->truncated_on_left_p && pt_old < bpos_min) + || (row->truncated_on_right_p && pt_old > bpos_max) + /* Zero-width characters produce no glyphs. */ + || (!empty_line_p + && (row->reversed_p + ? glyph_after > glyphs_end + : glyph_after < glyphs_end))))) { cursor = glyph_after; x = -1;