From f923ad94c799175177f5a0f333824b201eaf5088 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 15 Dec 2021 21:55:18 +0000 Subject: jao-minibuffer: make room again for tray icons --- lib/eos/jao-minibuffer.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el index 100e809..36c5238 100644 --- a/lib/eos/jao-minibuffer.el +++ b/lib/eos/jao-minibuffer.el @@ -28,7 +28,7 @@ (defvar jao-minibuffer-msg-info '("")) (defvar jao-minibuffer-notification nil) (defvar jao-minibuffer-align-right-p t) -(defvar jao-minibuffer-right-margin (if window-system 0 1)) +(defvar jao-minibuffer-right-margin (if window-system "" " ")) (defvar jao-minibuffer-maximized-frames-p nil) (defvar jao-minibuffer-frame-width nil) (defvar jao-minibuffer-notification-timeout 5) @@ -41,11 +41,12 @@ (defun jao-minibuffer--text-with-padding (text) "Return TEXT with padding on the left. The padding pushes TEXT to the right edge of the mode-line." - (let* ((len (- (string-pixel-width text) jao-minibuffer-right-margin)) + (let* ((len (+ (string-pixel-width text) + (string-pixel-width jao-minibuffer-right-margin))) (padding (propertize "-" 'display `(space :align-to (- (+ right right-margin) (,len)))))) - (concat padding text))) + (concat padding text jao-minibuffer-right-margin))) (defun jao-minibuffer--trim (s w) (if (<= (string-width (or s "")) w) @@ -84,7 +85,7 @@ The padding pushes TEXT to the right edge of the mode-line." (jao-minibuffer--text-with-padding msg) (let* ((mw (jao-minibuffer--width)) (w (mod (or w (string-width (or (current-message) ""))) mw)) - (w (- mw w jao-minibuffer-right-margin))) + (w (- mw w (length jao-minibuffer-right-margin)))) (if (> w 0) (jao-minibuffer--trim msg w) "")))))) (defun jao-minibuffer--insert (msg) -- cgit v1.2.3