tumashu / ivy-posframe

ivy-posframe is a ivy extension, which let ivy use posframe to show its candidate menu, ivy-posframe is a **GNU ELPA** package.
414 stars 26 forks source link

Integration with swiper-isearch-toggle #93

Closed hnnazm closed 4 years ago

hnnazm commented 4 years ago

I used Isearch mainly for searching and navigating and sometime use swiper for doing bigger search. So I bound a key to swiper-isearch-toggle . The problem is when I do my Isearch and swiper I just want to used the default minibuf to avoid blocking my view. When I toggle from Isearch to swiper, the frame is are not obeying the swiper function.

I tried this function but didn't work.

(setq ivy-posframe-display-functions-alist
'((swiper          . nil)
(t               . ivy-posframe-display-at-frame-center)))
(ivy-posframe-mode 1)

I also try this

(setq ivy-posframe-display-functions-alist
    '((swiper-isearch-toggle          . nil)
    (t               . ivy-posframe-display-at-frame-center)))
(ivy-posframe-mode 1)

and still didn't work.

Any idea how could I achieve this?

SreenivasVRao commented 4 years ago

Hi, I'm facing the issue - how did you solve this?

I have a minimal spacemacs reproduction example: emacs 26.3, spacemacs develop branch at commit c6f47bd870853 on OSX.

https://pastebin.com/pUpPheZX - this is the spacemacs config I used.

Swiper defaults to display-at-frame-top-center

cc @tumashu

My fix was to use:

(setq ivy-posframe-display-functions-alist
'((swiper . ivy-display-function-fallback)
(t . ivy-posframe-display-at-frame-center)))
(ivy-posframe-mode 1)
hnnazm commented 4 years ago

You need to explicitly define what the type of search. Use swiper-isearch instead of swiper In my case, this should solve it.

(setq ivy-posframe-display-functions-alist
         '((swiper-isearch  . nil)
               (t               . ivy-posframe-display-at-frame-center)))

(ivy-posframe-mode 1)