From: Eli Zaretskii Date: Sat, 8 Oct 2011 13:03:43 +0000 (+0200) Subject: Fix cursor positioning in hscrolled lines with R2L characters. X-Git-Tag: emacs-pretest-24.0.91~182 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7061c986301ecc3d69c73a9d8b6a51299bd4fb6a;p=emacs.git Fix cursor positioning in hscrolled lines with R2L characters. src/xdisp.c (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L lines that are hscrolled on the left. --- diff --git a/src/ChangeLog b/src/ChangeLog index 3f93987c0f1..4409d5e7f60 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,8 @@ * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left lines. + (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L + lines that are hscrolled on the left. * dispnew.c (buffer_posn_from_coords): Account for a possible presence of header-line. (Bug#4426) diff --git a/src/xdisp.c b/src/xdisp.c index 2fff6d9518c..e7fc1b4b37e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13890,7 +13890,11 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, ? glyph_after > glyphs_end : glyph_after < glyphs_end))))) { - cursor = glyph_after; + if (!match_with_avoid_cursor + && row->truncated_on_left_p && pt_old < bpos_min) + cursor = glyph_before; + else + cursor = glyph_after; x = -1; } else if (string_seen)