]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix picture-mode with full-width characters
authorEli Zaretskii <eliz@gnu.org>
Sun, 10 Nov 2024 09:48:34 +0000 (11:48 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 15 Nov 2024 12:40:47 +0000 (13:40 +0100)
* lisp/textmodes/picture.el (picture-insert): Don't rely on
'move-to-column' to move to the column that is its argument: this
might be false when full-width characters are involved.

(cherry picked from commit 3954e8d9bbed902e750c9e0647c6527ae32523b9)

lisp/textmodes/picture.el

index 37d1e59ac6e2156fb348e62350148ca8886afc96..afbd209347b4f00b75fe7599cc3ca7ee79a08850 100644 (file)
@@ -257,12 +257,14 @@ Use \"\\[command-apropos] picture-movement\" to see commands which control motio
                   (> width 1)
                   (< (abs picture-horizontal-step) 2))
              (* picture-horizontal-step 2)
-           picture-horizontal-step)))
+           picture-horizontal-step))
+         actual-col)
     (while (> arg 0)
       (setq arg (1- arg))
       (if (/= picture-desired-column (current-column))
-         (move-to-column picture-desired-column t))
-      (let ((col (+ picture-desired-column width)))
+         (setq actual-col (move-to-column picture-desired-column t))
+        (setq actual-col picture-desired-column))
+      (let ((col (+ actual-col width)))
        (or (eolp)
            (let ((pos (point))
                   (col0 (current-column))