popper icon indicating copy to clipboard operation
popper copied to clipboard

Disable centaur-tags when popper popup is active?

Open anildigital opened this issue 3 years ago • 6 comments

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

anildigital avatar Apr 01 '22 05:04 anildigital

What are centaur-tags? A google search didn't give me anything relevant beyond the github page for centaur-emacs.

karthink avatar Apr 01 '22 19:04 karthink

@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

anildigital avatar Apr 05 '22 06:04 anildigital

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))

karthink avatar Apr 06 '22 03:04 karthink

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

anildigital avatar Apr 06 '22 06:04 anildigital

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.

karthink avatar Apr 07 '22 21:04 karthink

@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)

anildigital avatar Apr 13 '22 13:04 anildigital