branch: externals/hydra
commit 8a9124f80b6919ad5288172b3e9f46c5332763ca
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
hydra.el: Fix hydra-curr-map nil when hydras are nested via :post
The :post handler is called by el:hydra-keyboard-quit, which calls
el:hydra-disable, and
then sets el:hydra-curr-map to nil.
This is fine if there's only one hydra. However, for nesting hydras like
yours this
happens:
- hydra-b sets el:hydra-curr-map to map-b
- el:hydra-keyboard-quit calls the :post handler and sets it to map-a
- el:hydra-keyboard-quit then sets it to nil
The fix is to set `hydra-curr-map' in `hydra-disable' before :post is
called.
Fixes #375
---
hydra.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hydra.el b/hydra.el
index afdf0f5c34..5fad230bfa 100644
--- a/hydra.el
+++ b/hydra.el
@@ -159,6 +159,7 @@ warn: keep KEYMAP and issue a warning instead of running
the command."
(with-selected-frame frame
(when overriding-terminal-local-map
(internal-pop-keymap hydra-curr-map 'overriding-terminal-local-map))))
+ (setq hydra-curr-map nil)
(unless hydra--ignore
(when hydra-curr-on-exit
(let ((on-exit hydra-curr-on-exit))
@@ -526,7 +527,6 @@ Remove :color key. And sort the plist alphabetically."
(hydra-disable)
(cancel-timer hydra-timeout-timer)
(cancel-timer hydra-message-timer)
- (setq hydra-curr-map nil)
(unless (and hydra--ignore
(null hydra--work-around-dedicated))
(funcall