[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 b70dba4: Fix picture-mode wrt double-width charac
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-25 b70dba4: Fix picture-mode wrt double-width characters |
Date: |
Fri, 15 Jan 2016 08:27:18 +0000 |
branch: emacs-25
commit b70dba4e18514411ed38b5bbb846558158842ace
Author: Alan J Third <address@hidden>
Commit: Eli Zaretskii <address@hidden>
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)
Copyright-paperwork-exempt: yes
---
lisp/textmodes/picture.el | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 4aee273..b77f8e9 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -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))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 b70dba4: Fix picture-mode wrt double-width characters,
Eli Zaretskii <=