summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/eos/jao-minibuffer.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el
index 36c5238..6445393 100644
--- a/lib/eos/jao-minibuffer.el
+++ b/lib/eos/jao-minibuffer.el
@@ -1,6 +1,6 @@
;;; jao-minibuffer.el --- using the minibuffer to report status -*- lexical-binding: t; -*-
-;; Copyright (C) 2020, 2021 jao
+;; Copyright (C) 2020, 2021, 2022 jao
;; Author: jao <mail@jao.io>
;; Keywords: extensions
@@ -81,12 +81,14 @@ The padding pushes TEXT to the right edge of the mode-line."
(string-trim-left msg)))
(msg (propertize msg :minibuffer-message t)))
(when (not (string-empty-p msg))
- (if (and window-system jao-minibuffer-align-right-p)
+ (if (and (fboundp 'string-pixel-width)
+ window-system
+ jao-minibuffer-align-right-p)
(jao-minibuffer--text-with-padding msg)
(let* ((mw (jao-minibuffer--width))
- (w (mod (or w (string-width (or (current-message) ""))) mw))
- (w (- mw w (length jao-minibuffer-right-margin))))
- (if (> w 0) (jao-minibuffer--trim msg w) ""))))))
+ (w (mod (or w (string-width (or (current-message) ""))) mw))
+ (w (- mw w (length jao-minibuffer-right-margin))))
+ (if (> w 0) (jao-minibuffer--trim msg w) ""))))))
(defun jao-minibuffer--insert (msg)
(with-current-buffer jao-minibuffer--name