emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master ac16227 27/78: Add padding for wide-width character


From: Oleh Krehel
Subject: [elpa] master ac16227 27/78: Add padding for wide-width character
Date: Sat, 23 Jan 2016 13:59:50 +0000

branch: master
commit ac162279f2194f9b7c4ec06afa6a7a68b9177149
Author: Akira Tamamori <address@hidden>
Commit: Akira Tamamori <address@hidden>

    Add padding for wide-width character
    
    Add padding for wide-width character (ex. Japanese and Chinese).
---
 avy.el |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/avy.el b/avy.el
index 5d1838f..fb162f3 100644
--- a/avy.el
+++ b/avy.el
@@ -649,7 +649,10 @@ LEAF is normally ((BEG . END) . WND)."
     (overlay-put ol 'window wnd)
     (overlay-put ol 'display (if (string= old-str "\n")
                                  (concat str "\n")
-                               str))
+                               ;; add padding for wide-width character
+                               (if (eq (string-width old-str) 2)
+                                   (concat str " ")
+                                 str)))
     (push ol avy--overlays-lead)))
 
 (defun avy--overlay-at-full (path leaf)
@@ -727,7 +730,10 @@ LEAF is normally ((BEG . END) . WND)."
                              ((string= old-str "\t")
                               (concat str (make-string (- tab-width len) ?\ )))
                              (t
-                              str)))
+                              ;; add padding for wide-width character
+                              (if (eq (string-width old-str) 2)
+                                  (concat str " ")
+                                str))))
           (push ol avy--overlays-lead))))))
 
 (defun avy--overlay-post (path leaf)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]