From de53dfcea3e1fdc6af171678300deb591b509cc4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 10 May 2017 19:58:06 +0300 Subject: [PATCH] Fix vertical cursor motion when columns are of unequal size * lisp/simple.el (line-move-finish): In line-move-visual mode, use vertical-motion to move to the goal column, as the goal column should in that case be interpreted in units of frame's canonical character width. (Bug#26852) --- lisp/simple.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index edc822eb51e..dfa30372dda 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6399,7 +6399,12 @@ If NOERROR, don't signal an error if we can't move that many lines." (point)))) ;; Move to the desired column. - (line-move-to-column (truncate column)) + (if line-move-visual + ;; Under line-move-visual, goal-column should be + ;; interpreted in units of the frame's canonical character + ;; width, which is exactly what vertical-motion does. + (vertical-motion (cons column 0)) + (line-move-to-column (truncate column))) ;; Corner case: suppose we start out in a field boundary in ;; the middle of a continued line. When we get to -- 2.39.2