From: Eli Zaretskii Date: Sun, 10 Nov 2024 09:48:34 +0000 (+0200) Subject: Fix picture-mode with full-width characters X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4a412126a46fa91efa0d2a91b5b1add1dc15cccc;p=emacs.git Fix picture-mode with full-width characters * 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) --- diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index 37d1e59ac6e..afbd209347b 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -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))