]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix cursor misalignment on truncated RTL rows
authorPo Lu <luangruo@yahoo.com>
Sun, 5 May 2024 01:38:27 +0000 (09:38 +0800)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:39:19 +0000 (18:39 +0200)
* src/xdisp.c (set_cursor_from_row): Begin computing the
position of the rightmost glyph from row->x, not 0.

(cherry picked from commit 129312aa12c2f9c2cc44fcbdecb6b6a45b7588f4)

src/xdisp.c

index 92b1fbfc3c7e445f3006a3668e962e343760d139..7d7666e6ee6dde92253bc09d141324ceac8b46e5 100644 (file)
@@ -18182,7 +18182,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
            --glyph;
          /* By default, in reversed rows we put the cursor on the
             rightmost (first in the reading order) glyph.  */
-         for (x = 0, g = end + 1; g < glyph; g++)
+         for (x = row->x, g = end + 1; g < glyph; g++)
            x += g->pixel_width;
          while (end < glyph
                 && NILP ((end + 1)->object)