From 4520b858c1d64bf61db1ae7b00b1b84e0cc645bd Mon Sep 17 00:00:00 2001 From: Jan D Date: Sun, 29 Aug 2010 12:30:45 +0200 Subject: [PATCH] * nsterm.m (ns_draw_window_cursor): Draw BAR_CURSOR correct for R2L. --- src/ChangeLog | 4 ++++ src/nsterm.m | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 8a3714bcf0d..b58557a944e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-08-29 Jan Djärv + + * nsterm.m (ns_draw_window_cursor): Draw BAR_CURSOR correct for R2L. + 2010-08-26 Kenichi Handa * xdisp.c (compute_stop_pos): Pay attention to bidi scan direction diff --git a/src/nsterm.m b/src/nsterm.m index 2eb84607562..f0efb948ab9 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2251,6 +2251,11 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, struct frame *f = WINDOW_XFRAME (w); struct glyph *phys_cursor_glyph; int overspill; + struct glyph *cursor_glyph; + + /* If cursor is out of bounds, don't draw garbage. This can happen + in mini-buffer windows when switching between echo area glyphs + and mini-buffer. */ NSTRACE (dumpcursor); //fprintf(stderr, "drawcursor (%d,%d) activep = %d\tonp = %d\tc_type = %d\twidth = %d\n",x,y, active_p,on_p,cursor_type,cursor_width); @@ -2328,6 +2333,13 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, case BAR_CURSOR: s = r; s.size.width = min (cursor_width, 2); //FIXME(see above) + + /* If the character under cursor is R2L, draw the bar cursor + on the right of its glyph, rather than on the left. */ + cursor_glyph = get_phys_cursor_glyph (w); + if ((cursor_glyph->resolved_level & 1) != 0) + s.origin.x += cursor_glyph->pixel_width - s.size.width; + NSRectFill (s); break; } -- 2.11.4.GIT