diff --git a/src/xdisp.c b/src/xdisp.c index fb8eaf4b967..125d3ed7f0f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9227,10 +9227,10 @@ move_it_in_display_line_to (struct it *it, || prev_method == GET_FROM_STRING) /* Passed TO_CHARPOS from left to right. */ && ((prev_pos < to_charpos - && IT_CHARPOS (*it) > to_charpos) + && IT_CHARPOS (*it) >= to_charpos) /* Passed TO_CHARPOS from right to left. */ || (prev_pos > to_charpos - && IT_CHARPOS (*it) < to_charpos))))) + && IT_CHARPOS (*it) <= to_charpos))))) { if (it->line_wrap != WORD_WRAP || wrap_it.sp < 0) {