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

Disable centaur-tags when popper popup is active? #32

Open
anildigital opened this issue Apr 1, 2022 · 6 comments
Open

Disable centaur-tags when popper popup is active? #32

anildigital opened this issue Apr 1, 2022 · 6 comments

Comments

@anildigital
Copy link

anildigital commented Apr 1, 2022

Any way to disable centaur-tabs when popper popup is active? thanks

@karthink
Copy link
Owner

karthink commented Apr 1, 2022 via email

@anildigital
Copy link
Author

@karthink https://github.com/ema2159/centaur-tabs
I have added a hook as :hook ((popper-open-popup-hook . centaur-tabs-local-mode)) but that works for the first popper popup (e.g. I open vterm), no centaur-tabs are seen. But when I open second vterm tab, centaur tabs are seen there. Something wrong in the hook I have added

@karthink
Copy link
Owner

karthink commented Apr 6, 2022

Can you try adding this function instead?

(defun centaur-tabs-local-off ()
   (centaur-tabs-local-mode 0))

=> :hook ((popper-open-popup-hook . centaur-tabs-local-off))

@anildigital
Copy link
Author

thanks. I have added this

  :hook ((popper-open-popup-hook . centaur-tabs-local-off))
  :config
  (defun centaur-tabs-local-off ()
   (centaur-tabs-local-mode 0))

It's also not working as expected as I can see centaur-tabs applied to popper buffers

@karthink
Copy link
Owner

karthink commented Apr 7, 2022

I misunderstood what centaur-tabs-local-mode does, try this function instead:

(defun centaur-tabs-local-on ()
   (centaur-tabs-local-mode 1)

You can add this to popper-open-popup-hook and it should work consistently, but after the buffer is created. If you want it to apply to all vterm buffers you're better off adding it to vterm-mode-hook instead.

@anildigital
Copy link
Author

@karthink I tried following, but it's not working

(use-package
  popper
  :ensure t
  :bind (("C-`"   . popper-toggle-latest)
         ("M-`"   . popper-cycle)
         ("C-M-`" . popper-toggle-type))
  :hook (
         (popper-open-popup-hook . centaur-tabs-local-off)
         (vterm-mode-hook . centaur-tabs-local-off)
         )
  :config
  (defun centaur-tabs-local-off ()
   (centaur-tabs-local-mode 1))
  :init
  (setq popper-reference-buffers '("eshell*"
                                   "shell*"
                                   "vterm"
                                   "*SQL"
                                   "*exunit-compilation*"
                                   help-mode
                                   compilation-mode))
  (popper-mode +1)
  (popper-echo-mode +1))

I also tried with both (centaur-tabs-local-mode 1) and (centaur-tabs-local-mode 0)

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