completion/ivy: ivy-posframe upstream update
This commit is contained in:
parent
32e266cfb4
commit
761bc570aa
1 changed files with 3 additions and 19 deletions
|
@ -257,12 +257,7 @@ immediately runs it on the current candidate (ending the ivy session)."
|
||||||
|
|
||||||
(def-package! ivy-posframe
|
(def-package! ivy-posframe
|
||||||
:when (and EMACS26+ (featurep! +childframe))
|
:when (and EMACS26+ (featurep! +childframe))
|
||||||
:hook (ivy-mode . ivy-posframe-enable)
|
:hook (ivy-mode . ivy-posframe-mode)
|
||||||
:preface
|
|
||||||
;; This function searches the entire `obarray' just to populate
|
|
||||||
;; `ivy-display-functions-props'. There are 15k entries in mine! This is
|
|
||||||
;; wasteful, so...
|
|
||||||
(advice-add #'ivy-posframe-setup :override #'ignore)
|
|
||||||
:config
|
:config
|
||||||
(setq ivy-fixed-height-minibuffer nil
|
(setq ivy-fixed-height-minibuffer nil
|
||||||
ivy-posframe-parameters
|
ivy-posframe-parameters
|
||||||
|
@ -270,19 +265,8 @@ immediately runs it on the current candidate (ending the ivy session)."
|
||||||
(min-height . ,ivy-height)
|
(min-height . ,ivy-height)
|
||||||
(internal-border-width . 10)))
|
(internal-border-width . 10)))
|
||||||
|
|
||||||
;; ... let's do it manually instead
|
|
||||||
(unless (assq 'ivy-posframe-display-at-frame-bottom-left ivy-display-functions-props)
|
|
||||||
(dolist (fn (list 'ivy-posframe-display-at-frame-bottom-left
|
|
||||||
'ivy-posframe-display-at-frame-center
|
|
||||||
'ivy-posframe-display-at-point
|
|
||||||
'ivy-posframe-display-at-frame-bottom-window-center
|
|
||||||
'ivy-posframe-display
|
|
||||||
'ivy-posframe-display-at-window-bottom-left
|
|
||||||
'ivy-posframe-display-at-window-center
|
|
||||||
'+ivy-display-at-frame-center-near-bottom))
|
|
||||||
(push (cons fn '(:cleanup ivy-posframe-cleanup)) ivy-display-functions-props)))
|
|
||||||
;; default to posframe display function
|
;; default to posframe display function
|
||||||
(setf (alist-get t ivy-display-functions-alist) #'+ivy-display-at-frame-center-near-bottom)
|
(setf (alist-get t ivy-posframe-display-functions-alist) #'+ivy-display-at-frame-center-near-bottom)
|
||||||
|
|
||||||
;; Fix #1017: stop session persistence from restoring a broken posframe
|
;; Fix #1017: stop session persistence from restoring a broken posframe
|
||||||
(defun +workspace|delete-all-posframes (&rest _) (posframe-delete-all))
|
(defun +workspace|delete-all-posframes (&rest _) (posframe-delete-all))
|
||||||
|
@ -290,7 +274,7 @@ immediately runs it on the current candidate (ending the ivy session)."
|
||||||
|
|
||||||
;; posframe doesn't work well with async sources
|
;; posframe doesn't work well with async sources
|
||||||
(dolist (fn '(swiper counsel-ag counsel-grep counsel-git-grep))
|
(dolist (fn '(swiper counsel-ag counsel-grep counsel-git-grep))
|
||||||
(setf (alist-get fn ivy-display-functions-alist) #'ivy-display-function-fallback)))
|
(setf (alist-get fn ivy-posframe-display-functions-alist) #'ivy-display-function-fallback)))
|
||||||
|
|
||||||
|
|
||||||
(def-package! flx
|
(def-package! flx
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue