-
Notifications
You must be signed in to change notification settings - Fork 139
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
Keypad self insert regression #698
Comments
I'm curious about the use case on this feature. In which scenario it is useful? |
It allows for interaction with electric pair mode from normal mode. You can select some thing, then press "SPC (" to surround it with parens. It is possible that this should be it's own thing, like a self insert next key. |
Probably it's better to just bind |
I thought the intent was to insert a key when it was undefined. Isn't that the behavior that (defcustom meow-keypad-self-insert-undefined t
"Whether to self-insert a key in keypad mode if it is undefined"
:group 'meow
:type 'boolean) I, too, have become used to using it in the way described by @Haxxflaxx. If we want to change how undefined keys are handled in the leader map, it's important to recognize that it's a breaking change. That would ideally involve some notice of deprecation and clear way to migrate. Furthermore, I can't seem to achieve the effect you indicate by binding (meow-leader-define-key
;; SPC j/k will run the original command in MOTION state.
'("j" . "H-j")
'("k" . "H-k")
'("(" . self-insert-command)
'("/" . meow-keypad-describe-key)
'("?" . meow-cheatsheet))
|
It seems like character isn't updated to whatever is pressed inside the prefix, but instead remains the space key. |
I see. But we need to find a way to make it work again. After the keypad refactor, now the whole key sequences are input in a loop in one command instead of a list of |
I've tried adding an explicit self-insert-command to (if meow-keypad-self-insert-undefined
(self-insert-command (or current-prefix-arg 1) (string-to-char key-str))
(message "%s is undefined" (meow--keypad-format-keys nil))) but it doesn't work as expected. The For this to work as before I think we would need to get last-command-event to be what we pressed in the keypad. |
(setq last-command-event (string-to-char key-str))
(if meow-keypad-self-insert-undefined
(call-interactively 'self-insert-command)
(message "%s is undefined" (meow--keypad-format-keys nil))) Could be an option if it is save to set the variable. |
I made a PR with a suggestion on how we can solve this, but I need to research further as it doesn't interact well with beacon state. |
It would be tricky because in kmacro recording, it is the KEY that gets recorded. We could think a better way to achieve the result instead of hacking here. |
I don't know if I would consider this a hack, but it is an implementation with quite a narrow understanding of the codebase. After some further research into how keypad execution on beacons work I understand that naturally I need to let I also now see that my previous assumption that it would work to bind self insert with a disabled |
I've also updated After updating |
I just noticed that keypad no longer triggers repeat maps either. I wonder if the reason is similar? |
After digging into the issue a bit more found that it is indeed the same issue. In the solution which means we can't set |
@Kenneth-Mata yes, this is the same thing. It is due to last-command-event not getting updated when executing something from the keypad. A quick fix could be to do something like: (defun my/meow-digit-argument ()
(interactive)
(let ((last-command-event last-input-event))
(meow-digit-argument))) Note that this fix will work poorly for some things as it won't register modifier keys (as you don't press them while using the keypad) but it should work for numbers. |
Just opened another PR #705 for another potential solution. |
It is no longer possible to insert characters from the keypad.
The regression was introduced in 8ae8b2c.
The text was updated successfully, but these errors were encountered: