From 372cc9e88c9dad94a29082269d2424723b28eaee Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Oct 2022 09:24:04 +0300 Subject: [PATCH] Fix 'C-a' and 'C-e' under 'visual-line-mode' * src/xdisp.c (move_it_vertically_backward): Fix last change. (Bug#58210) --- src/xdisp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 55e74a36037..95e97a0bb8e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10776,7 +10776,9 @@ move_it_vertically_backward (struct it *it, int dy) if (dy == 0) { /* Adjust nlines for increasing it at the beginning. */ - nlines -= !!it->bidi_p; + if (it2.bidi_p + && !(it2.line_wrap == WORD_WRAP && it2.continuation_lines_width)) + nlines--; /* DY == 0 means move to the start of the screen line. The value of nlines is > 0 if continuation lines were involved, or if the original IT position was at start of a line. */ -- 2.39.2