summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog2
-rw-r--r--src/xdisp.c18
2 files changed, 14 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index efe542e37d0..039c225c1f6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -3,6 +3,8 @@
* xdisp.c (set_cursor_from_row): Fix cursor positioning when a
display property strides EOL and includes a newline, as in
longlines-mode. (Bug#9254)
+ (move_it_in_display_line_to): Fix vertical-motion in a buffer with
+ word-wrap under bidirectional display. (Bug#9224)
* bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
is non-zero, even if the data buffer is NULL. Fixes a crash in
diff --git a/src/xdisp.c b/src/xdisp.c
index 9c281c6736b..6e9474e3c10 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8009,13 +8009,19 @@ move_it_in_display_line_to (struct it *it,
positions smaller than TO_CHARPOS, return
MOVE_POS_MATCH_OR_ZV, like the unidirectional display
did. */
- if (it->bidi_p && (op & MOVE_TO_POS) != 0
- && !saw_smaller_pos
- && IT_CHARPOS (*it) > to_charpos)
+ if (it->bidi_p && (op & MOVE_TO_POS) != 0)
{
- if (IT_CHARPOS (ppos_it) < ZV)
- RESTORE_IT (it, &ppos_it, ppos_data);
- goto buffer_pos_reached;
+ if (!saw_smaller_pos && IT_CHARPOS (*it) > to_charpos)
+ {
+ if (IT_CHARPOS (ppos_it) < ZV)
+ RESTORE_IT (it, &ppos_it, ppos_data);
+ goto buffer_pos_reached;
+ }
+ else if (it->line_wrap == WORD_WRAP && atpos_it.sp >= 0
+ && IT_CHARPOS (*it) > to_charpos)
+ goto buffer_pos_reached;
+ else
+ result = MOVE_NEWLINE_OR_CR;
}
else
result = MOVE_NEWLINE_OR_CR;