From 5a220cd93c522a5b861312bb742f1cd111c4d6a2 Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 28 Feb 2022 22:31:31 +0000 Subject: jao-minibuffer: minibuffer overlay --- lib/eos/jao-minibuffer.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el index e48e6ea..09497e8 100644 --- a/lib/eos/jao-minibuffer.el +++ b/lib/eos/jao-minibuffer.el @@ -60,6 +60,11 @@ (dolist (o jao-minibuffer--overlays) (when (overlay-buffer o) (overlay-put o 'after-string txt))))) +(defun jao-minibuffer--minibuffer-setup () + (push (make-overlay (point-max) (point-max) nil t t) jao-minibuffer--overlays) + (overlay-put (car jao-minibuffer--overlays) 'priority 1) + (jao-minibuffer-refresh)) + (defun jao-minibuffer--trim (s w) (if (<= (string-width (or s "")) w) (format (format "%%%ds" (if jao-minibuffer-align-right-p w (- w))) s) @@ -178,9 +183,11 @@ (progn (advice-add 'select-window :after #'jao-minibuffer-refresh) (advice-add 'force-mode-line-update :after #'jao-minibuffer-refresh) (jao-minibuffer--create-overlays) + (add-hook 'minibuffer-setup-hook #'jao-minibuffer--minibuffer-setup) (jao-minibuffer-refresh)) (advice-remove 'select-window #'jao-minibuffer-refresh) (advice-remove 'force-mode-line-update #'jao-minibuffer-refresh) + (remove-hook 'minibuffer-setup-hook #'jao-minibuffer--minibuffer-setup) (jao-minibuffer--remove-overlays) (jao-minibuffer--insert ""))) -- cgit v1.2.3