diff options
author | jao <jao@gnu.org> | 2020-10-27 03:56:26 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-10-27 03:56:26 +0000 |
commit | df16f2939e1c8a68a7df3bf68d3449653e81ecd7 (patch) | |
tree | 47eb646068c959d5c947255f4fd3a223abd23b5a | |
parent | 6e793f022edb47cf0d222a49dffd60fd282ec263 (diff) | |
download | elibs-df16f2939e1c8a68a7df3bf68d3449653e81ecd7.tar.gz elibs-df16f2939e1c8a68a7df3bf68d3449653e81ecd7.tar.bz2 |
jao-minibuffer: using frame width for maximized scenarios
-rw-r--r-- | misc/jao-minibuffer.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/misc/jao-minibuffer.el b/misc/jao-minibuffer.el index e55e5a2..70829bb 100644 --- a/misc/jao-minibuffer.el +++ b/misc/jao-minibuffer.el @@ -27,6 +27,7 @@ (defvar jao-minibuffer-info ()) (defvar jao-minibuffer-align-right-p t) (defvar jao-minibuffer-right-margin 2) +(defvar jao-minibuffer-maximized-frames-p t) (defconst jao-minibuffer--name " *Minibuf-0*") @@ -39,7 +40,9 @@ (let ((msg (format-mode-line jao-minibuffer-info))) (when (not (string-empty-p msg)) (if jao-minibuffer-align-right-p - (let* ((mw (window-width (minibuffer-window))) + (let* ((mw (if jao-minibuffer-maximized-frames-p + (frame-width) + (window-width (minibuffer-window)))) (w (- mw (or w 0) jao-minibuffer-right-margin))) (if (> w 0) (jao-minibuffer--trim msg w) "")) (concat " ยท " msg))))) @@ -59,7 +62,7 @@ (interactive "") (with-current-buffer jao-minibuffer--name (erase-buffer) - (insert (jao-minibuffer--aligned)))) + (insert (or (jao-minibuffer--aligned) "")))) ;;;###autoload (defun jao-minibuffer-add-variable (variable-name &optional append) |