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

Cannot bind <tab> in keypad #610

Open
tbdcit opened this issue Jun 23, 2024 · 3 comments
Open

Cannot bind <tab> in keypad #610

tbdcit opened this issue Jun 23, 2024 · 3 comments

Comments

@tbdcit
Copy link

tbdcit commented Jun 23, 2024

The following does not seem to work

(meow-leader-define-key
 '("TAB" . meow-last-buffer)
 '("<tab>" . meow-last-buffer))

I have (setq meow-keypad-leader-dispatch "C-c") and C-c <tab> works as expected, but <space> <tab> does not.

@eshrh
Copy link
Member

eshrh commented Jun 23, 2024

I can't reproduce this; your code works for me. Would you post your whole config somewhere?

@tbdcit
Copy link
Author

tbdcit commented Jun 23, 2024

It seems that the problem is only in modes that bind "C-c TAB". In org-mode for example: describe-key "C-c TAB" reports meow-last-buffer but meow-keypad-describe-key TAB reports org-ctrl-c-tab.

The meow part of my config can be found here: https://purple-noell-46.tiiny.site.

@xevrem
Copy link

xevrem commented Jul 16, 2024

I can't reproduce this; your code works for me. Would you post your whole config somewhere?

binding TAB or <tab> in meow's meow-leader-define-key appears to only work as expected in GUI mode. In terminal mode, it fails; as it doesn't seem to properly resolve TAB and <tab>, instead falling back to whatever the self-insert-command resolve to... looking at the code for meow-keypad, it appears to explicitly ignore terminal local maps in lieu of gui local maps.

the workaround I have works (in GUI and terminal) by forcibly rebindinding the keypad keymap with a custom meow-last-buffer function:

    ;; light wrapper around meow-last-buffer so binding hacks below will function
    (defun custo/meow-last-buffer ()
      "Goto last buffer."
      (interactive)
      (meow-last-buffer nil)
      (meow-keypad-quit) ;; or use (meow--keypad-quit) to prevent the mode-line spam
      )
    ;; forces which-key to display binding
    (meow-leader-define-key
      '("TAB" . custo/meow-last-buffer)
      '("<tab>" . custo/meow-last-buffer)
      )
    ;; fix the broken binding above in terminals by avoiding most of the problematic magic wrappers
    (meow-define-keys
      'keypad
      '("TAB" . custo/meow-last-buffer)
      '("<tab>" . custo/meow-last-buffer)
      )

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

3 participants