diff options
-rw-r--r-- | misc/jao-minibuffer.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/misc/jao-minibuffer.el b/misc/jao-minibuffer.el index 9f28390..e55e5a2 100644 --- a/misc/jao-minibuffer.el +++ b/misc/jao-minibuffer.el @@ -28,7 +28,7 @@ (defvar jao-minibuffer-align-right-p t) (defvar jao-minibuffer-right-margin 2) -;; (setq jao-minibuffer-align-right-p t) +(defconst jao-minibuffer--name " *Minibuf-0*") (defun jao-minibuffer--trim (s w) (if (<= (length s) w) @@ -39,7 +39,8 @@ (let ((msg (format-mode-line jao-minibuffer-info))) (when (not (string-empty-p msg)) (if jao-minibuffer-align-right-p - (let ((w (- (frame-width) (or w 0) jao-minibuffer-right-margin))) + (let* ((mw (window-width (minibuffer-window))) + (w (- mw (or w 0) jao-minibuffer-right-margin))) (if (> w 0) (jao-minibuffer--trim msg w) "")) (concat " ยท " msg))))) @@ -56,7 +57,7 @@ ;;;###autoload (defun jao-minibuffer-refresh () (interactive "") - (with-current-buffer " *Minibuf-0*" + (with-current-buffer jao-minibuffer--name (erase-buffer) (insert (jao-minibuffer--aligned)))) |