From: Eli Zaretskii Date: Wed, 18 Aug 2010 16:42:06 +0000 (+0300) Subject: Fix display of bar cursor on right-to-left text. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~247 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9335210608653cef7a111d096dcfacd7bd87682a;p=emacs.git 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 --git a/src/ChangeLog b/src/ChangeLog index 45cccea1ebb..4033a424aed 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 --git a/src/w32term.c b/src/w32term.c index 947ed5c9d44..992538e0e88 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -4897,6 +4897,11 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, 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 --git a/src/xterm.c b/src/xterm.c index 4325fb3d991..420c5ccc7fd 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7158,6 +7158,11 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text 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),