summaryrefslogtreecommitdiff
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-03-07 22:00:33 +0200
committerEli Zaretskii <eliz@gnu.org>2014-03-07 22:00:33 +0200
commitb646ea12bdcdb31abece8ecce8bfd2e4ea1a682a (patch)
tree916d028d6fabc10efeab56f03abd4cd3d57eabec /src/xdisp.c
parent1920914a0911bcce40758c97482a62ca8fa1b862 (diff)
downloademacs-b646ea12bdcdb31abece8ecce8bfd2e4ea1a682a.tar.gz
Fix bug #16961 with visual-order cursor movement and word-wrap.
src/xdisp.c (Fmove_point_visually): When under word-wrap, accept also return value of MOVE_POS_MATCH_OR_ZV from move_it_in_display_line_to, when moving from beginning of line to point's position.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index b8e08a30e1c..1513d4a9a87 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20895,7 +20895,12 @@ Value is the new character position of point. */)
new_pos = it.current.pos;
while (it.current_x + it.pixel_width <= target_x
- && rc == MOVE_X_REACHED)
+ && (rc == MOVE_X_REACHED
+ /* Under word-wrap, move_it_in_display_line_to
+ stops at correct coordinates, but sometimes
+ returns MOVE_POS_MATCH_OR_ZV. */
+ || (it.line_wrap == WORD_WRAP
+ && rc == MOVE_POS_MATCH_OR_ZV)))
{
int new_x = it.current_x + it.pixel_width;