summaryrefslogtreecommitdiff
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-12-14 21:32:50 +0200
committerEli Zaretskii <eliz@gnu.org>2013-12-14 21:32:50 +0200
commit2897da4d7be9f0082e88140ef2de2c463d62fea7 (patch)
treef1a121f271b39cd92fc70f5ae616b74248f8caeb /src/xdisp.c
parent31b4827ea9ba8d22deb17c0593f0f555a33e1fa4 (diff)
Fix bug #16148 with visual-mode cursor motion and whitespace-newline-mode.
src/xdisp.c (Fmove_point_visually): Expect overshoot in move_it_to when character at point is displayed from a display vector.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 6daa913115..3974810908 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20505,11 +20505,12 @@ Value is the new character position of point. */)
SET_TEXT_POS (pt, PT, PT_BYTE);
start_display (&it, w, pt);
- if (it.cmp_it.id < 0
- && it.method == GET_FROM_STRING
- && it.area == TEXT_AREA
- && it.string_from_display_prop_p
- && (it.sp > 0 && it.stack[it.sp - 1].method == GET_FROM_BUFFER))
+ if ((it.cmp_it.id < 0
+ && it.method == GET_FROM_STRING
+ && it.area == TEXT_AREA
+ && it.string_from_display_prop_p
+ && (it.sp > 0 && it.stack[it.sp - 1].method == GET_FROM_BUFFER))
+ || it.method == GET_FROM_DISPLAY_VECTOR)
overshoot_expected = true;
/* Find the X coordinate of point. We start from the beginning
@@ -20553,7 +20554,12 @@ Value is the new character position of point. */)
glyph to the left of point, so we need to correct the X
coordinate. */
if (overshoot_expected)
- pt_x += pixel_width;
+ {
+ if (it.bidi_p)
+ pt_x += pixel_width * it.bidi_it.scan_dir;
+ else
+ pt_x += pixel_width;
+ }
/* Compute target X coordinate, either to the left or to the
right of point. On TTY frames, all characters have the same