diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index 434d085cd..b345b0530 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -140,6 +140,28 @@ :config (setq wgrep-auto-save-buffer t)) +(def-package! posframe + :when (and EMACS26+ (featurep! +childframe)) + :after helm + :config + (defvar +helm--posframe-buffer nil) + + (defun +helm-posframe-display (buffer &optional _resume) + (posframe-show + (setq +helm--posframe-buffer buffer) + :poshandler #'posframe-poshandler-frame-bottom-left-corner + :left-fringe 10 + :width (frame-width) + :height 16 ;; ivy/+childframe uses 16 + :respect-header-line t)) + + (defun +helm|posframe-cleanup () + (posframe-hide +helm--posframe-buffer)) + + (add-hook 'helm-cleanup-hook #'+helm|posframe-cleanup) + (setq helm-display-function #'+helm-posframe-display)) + + ;; ;; Evil integration ;; diff --git a/modules/completion/helm/packages.el b/modules/completion/helm/packages.el index deb8465c7..9144ff576 100644 --- a/modules/completion/helm/packages.el +++ b/modules/completion/helm/packages.el @@ -12,3 +12,5 @@ (package! wgrep) (when (featurep! +fuzzy) (package! helm-flx)) +(when (and EMACS26+ (featurep! +childframe)) + (package! posframe))