1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix picture-mode wrt double-width characters

* lisp/textmodes/picture.el (picture-insert): Check the width of
the character being replaced, not just that of the replacement.
(Bug#1808)

[This reapplies commit b70dba4e18,
which was inadvertently lost by merge commit
7823745acb.]

Copyright-paperwork-exempt: yes
This commit is contained in:
Alan J Third 2016-01-15 10:26:10 +02:00 committed by Paul Eggert
parent fa5c69c0a3
commit 1e9a1229b1

View file

@ -272,7 +272,11 @@ Use \"\\[command-apropos] picture-movement\" to see commands which control motio
(or (eolp)
(let ((pos (point)))
(move-to-column col t)
(delete-region pos (point)))))
(let ((old-width (string-width (buffer-substring pos (point)))))
(delete-region pos (point))
(when (> old-width width)
(insert-char ? (- old-width width))
(goto-char pos))))))
(insert ch)
(forward-char -1)
(picture-move))))