wsw0108 / mini-popup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mini-popup.el

GNU Emacs

Install with package-install-from-file and enable with M-x mini-popup-mode RET.

;; Configure a height function (Example for Vertico)
(defun mini-popup-height-resize ()
  (* (1+ (min vertico--total vertico-count)) (default-line-height)))
(defun mini-popup-height-fixed ()
  (* (1+ (if vertico--input vertico-count 0)) (default-line-height)))
(setq mini-popup--height-function #'mini-popup-height-fixed)

;; Disable the minibuffer resizing of Vertico (HACK)
(advice-add #'vertico--resize-window :around
            (lambda (&rest args)
              (unless mini-popup-mode
                (apply args))))

;; Ensure that the popup is updated after refresh (Consult-specific)
(add-hook 'consult--completion-refresh-hook
          (lambda (&rest _) (mini-popup--setup)) 99)

About


Languages

Language:Emacs Lisp 100.0%