Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] make helm buffer can popup as done by shackle. #22

Closed
zw963 opened this issue Jan 13, 2022 · 5 comments
Closed

[Question] make helm buffer can popup as done by shackle. #22

zw963 opened this issue Jan 13, 2022 · 5 comments

Comments

@zw963
Copy link

zw963 commented Jan 13, 2022

Hi, thank you very much for this awesome package.

For my helm issue, is, when one windows get raised, helm will be limited into only in a very little window,

as like this.

image

helm window be limited into only compile buffer, for the normal case, helm should like behavior like this:

image

so, for resolve this issue, we can use shackle or popwin, i use former, like this:

(setq helm-display-function 'pop-to-buffer) ; make helm play nice

;; always keep helm 0.618% of height.
(setq shackle-rules '(("\\`\\*helm.*?\\*\\'" :regexp t :align t :size 0.618)))

(shackle-mode t)

But, i find popper! i am curious, is there exists a config for same effect as above shackle config?

Thank you!

@karthink
Copy link
Owner

@zw963 Popper does not provide window management features beyond the minimum necessary to display popups. Helm's height is being limited becuse Helm and Popper are both displayed in side-windows at the bottom of the frame. Note that you'll have the same problem whenever you use a side-window at the bottom along with Helm.

To fix this, you have a couple of options.

  1. Customize how Helm buffers are shown using Shackle or by customizing display-buffer-alist. The shackle rule from above translates to
(add-to-list 'display-buffer-alist
             '("\\`\\*helm.*?\\*\\'"
               (display-buffer-reuse-window display-buffer-at-bottom)
               (window-height . 0.618)))

although you may want to tweak it some more.

  1. OR Customize Popper to show its popups some other way. For example, you can make popups appear at the top using
(defun popper-select-popup-at-top (buffer &optional _alist)
  "Display popup-buffer BUFFER at the bottom of the screen."
  (let ((win (display-buffer-in-side-window
              buffer
              `((window-height . ,popper-window-height)
                (side . top)
                (slot . 1)))))
    (select-window win)))

(setq popper-display-function #'popper-select-popup-at-top)

@zw963
Copy link
Author

zw963 commented Jan 16, 2022

  1. Customize how Helm buffers are shown using Shackle or by customizing display-buffer-alist. The shackle rule from above translates to
(add-to-list 'display-buffer-alist
             '("\\`\\*helm.*?\\*\\'"
               (display-buffer-reuse-window display-buffer-at-bottom)
               (window-height . 0.618)))

In fact, not same.

because if work with treemacs, with above config, helm only popup on the right window of treemacs window, like this.

image

but, after use shackle, it will popup on full width window.

In fact, i use following config which adviced by helm maintainer for a long time, never use shackle,

(setq helm-always-two-windows nil) ;; this is default
(setq-default helm-display-buffer-default-height (* (frame-height) 0.618))
(setq helm-default-display-buffer-functions '(display-buffer-in-side-window))

until, i start use emacs-lsp, you know, many little window, helm always limited by this or another window.

But, i find this not a big issue anyway after i introduce popper and add those little window into popper as popup window, because i can always hide those windows, before use helm.

anyway, thank you.

@zw963
Copy link
Author

zw963 commented Jan 16, 2022

OR Customize Popper to show its popups some other way. For example, you can make popups appear at the top using

I try those code, it works! it really a new experience, i will try to play a while, though, that not fix my issue, because helm can be limited by other window which not added into popper-reference-buffers.

@karthink
Copy link
Owner

But, i find this not a big issue anyway after i introduce popper and add those little window into popper as popup window, because i can always hide those windows, before use helm.

The solution is to not use Helm in a side-window. You can use one of the other buffer display functions for helm-default-display-buffer-functions or write your own.

You could also show popups in a regular (i.e. non side-) window instead, but you will have continue to have issues with LSP windows etc.

@zw963
Copy link
Author

zw963 commented Jan 17, 2022

Thank you for help, let me use for a while, if have any usage issue, i will reopen here.

@zw963 zw963 closed this as completed Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants