# HG changeset patch # User Eli Zaretskii # Date 1282149726 -10800 # Node ID 1ada063020ba1e3a0356ca88fc68a405cf76c335 # Parent ecdbd21826dedf95a9168361a500492bc9d72751 Fix display of bar cursor on right-to-left text. xterm.c (x_draw_bar_cursor): w32term.c (x_draw_bar_cursor): If the character under cursor is R2L, draw the bar cursor on its right rather than on its left. diff -r ecdbd21826de -r 1ada063020ba src/ChangeLog --- a/src/ChangeLog Wed Aug 18 15:12:34 2010 +0200 +++ b/src/ChangeLog Wed Aug 18 19:42:06 2010 +0300 @@ -1,3 +1,9 @@ +2010-08-18 Eli Zaretskii + + * xterm.c (x_draw_bar_cursor): + * w32term.c (x_draw_bar_cursor): If the character under cursor is + R2L, draw the bar cursor on its right rather than on its left. + 2010-08-18 Stefan Monnier * eval.c (Fdefmacro): Only obey one declaration. diff -r ecdbd21826de -r 1ada063020ba src/w32term.c --- a/src/w32term.c Wed Aug 18 15:12:34 2010 +0200 +++ b/src/w32term.c Wed Aug 18 19:42:06 2010 +0300 @@ -4897,6 +4897,11 @@ w->phys_cursor_width = width; + /* If the character under cursor is R2L, draw the bar cursor + on the right of its glyph, rather than on the left. */ + if ((cursor_glyph->resolved_level & 1) != 0) + x += cursor_glyph->pixel_width - width; + w32_fill_area (f, hdc, cursor_color, x, WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), width, row->height); diff -r ecdbd21826de -r 1ada063020ba src/xterm.c --- a/src/xterm.c Wed Aug 18 15:12:34 2010 +0200 +++ b/src/xterm.c Wed Aug 18 19:42:06 2010 +0300 @@ -7158,6 +7158,11 @@ w->phys_cursor_width = width; + /* If the character under cursor is R2L, draw the bar cursor + on the right of its glyph, rather than on the left. */ + if ((cursor_glyph->resolved_level & 1) != 0) + x += cursor_glyph->pixel_width - width; + XFillRectangle (dpy, window, gc, WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),