summaryrefslogtreecommitdiffhomepage
path: root/eos
diff options
context:
space:
mode:
Diffstat (limited to 'eos')
-rw-r--r--eos/jao-minibuffer.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/eos/jao-minibuffer.el b/eos/jao-minibuffer.el
index 3294d4b..91662bf 100644
--- a/eos/jao-minibuffer.el
+++ b/eos/jao-minibuffer.el
@@ -36,7 +36,7 @@
(defconst jao-minibuffer--name " *Minibuf-0*")
(defun jao-minibuffer--trim (s w)
- (if (<= (length s) w)
+ (if (<= (string-width (or s "")) w)
(format (format "%%%ds" (if jao-minibuffer-align-right-p w (- w))) s)
(substring s 0 w)))
@@ -69,7 +69,7 @@
(msg (propertize msg :minibuffer-message t)))
(when (not (string-empty-p msg))
(let* ((mw (jao-minibuffer--width))
- (w (mod (or w (length (current-message))) mw))
+ (w (mod (or w (string-width (or (current-message) ""))) mw))
(w (- mw w jao-minibuffer-right-margin)))
(if (> w 0) (jao-minibuffer--trim msg w) "")))))
@@ -79,8 +79,9 @@
(let* ((msg (string-trim (replace-regexp-in-string "\n" " " msg)))
(msg (if (string-blank-p msg) msg (concat msg " "))))
(if jao-minibuffer-align-right-p
- (concat msg (jao-minibuffer--aligned (length msg) t))
- (concat (jao-minibuffer--aligned (+ 3 (length msg)) t) " " msg)))))
+ (concat msg (jao-minibuffer--aligned (string-width (or msg "")) t))
+ (concat (jao-minibuffer--aligned (+ 3 (string-width (or msg ""))) t)
+ " " msg)))))
(defun jao-minibuffer--insert (msg)
(with-current-buffer jao-minibuffer--name