From: Eli Zaretskii Date: Wed, 10 May 2017 16:58:06 +0000 (+0300) Subject: Fix vertical cursor motion when columns are of unequal size X-Git-Tag: emacs-26.0.90~521^2~420 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=de53dfcea3e1fdc6af171678300deb591b509cc4;p=emacs.git 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) --- 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