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 commitb70dba4e18, which was inadvertently lost by merge commit7823745acb.] Copyright-paperwork-exempt: yes
This commit is contained in:
parent
fa5c69c0a3
commit
1e9a1229b1
1 changed files with 5 additions and 1 deletions
|
|
@ -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))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue