diff options
author | jao <jao@gnu.org> | 2022-02-28 22:31:31 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-02-28 22:31:31 +0000 |
commit | 5a220cd93c522a5b861312bb742f1cd111c4d6a2 (patch) | |
tree | 3b0679a5132d62ae7e106053212e9003b319177d | |
parent | cbc69d579b703f7eb0eb3029ef7fb73801a7d81d (diff) | |
download | elibs-5a220cd93c522a5b861312bb742f1cd111c4d6a2.tar.gz elibs-5a220cd93c522a5b861312bb742f1cd111c4d6a2.tar.bz2 |
jao-minibuffer: minibuffer overlay
-rw-r--r-- | lib/eos/jao-minibuffer.el | 7 |
1 files changed, 7 insertions, 0 deletions
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 ""))) |