emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/which-key 1bb1f72: Fix key-chord handling


From: ELPA Syncer
Subject: [elpa] externals/which-key 1bb1f72: Fix key-chord handling
Date: Thu, 9 Dec 2021 08:57:40 -0500 (EST)

branch: externals/which-key
commit 1bb1f723dab2fc8b88b7f7273d0a7fa11134b936
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>

    Fix key-chord handling
    
    It turns out we don't need to do anything too tricky for key-chords, because
    this-single-command-raw-keys returns the correct key-sequence
    
    Fixes #254
---
 which-key.el | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/which-key.el b/which-key.el
index 0fa2fa3..edbad7a 100644
--- a/which-key.el
+++ b/which-key.el
@@ -2588,22 +2588,11 @@ Finally, show the buffer."
 (defun which-key--this-command-keys ()
   "Version of `this-single-command-keys' corrected for key-chords and 
god-mode."
   (let ((this-command-keys (this-single-command-keys)))
-    (when (and (equal this-command-keys [key-chord])
+    (when (and (vectorp this-command-keys)
+               (> (length this-command-keys) 0)
+               (eq (aref this-command-keys 0) 'key-chord)
                (bound-and-true-p key-chord-mode))
-      (setq this-command-keys
-            (condition-case nil
-                (let ((rkeys (recent-keys)))
-                  (vector 'key-chord
-                          ;; Take the two preceding the last one, because the
-                          ;; read-event call in key-chord seems to add a
-                          ;; spurious key press to this list. Note this is
-                          ;; different from guide-key's method which didn't 
work
-                          ;; for me.
-                          (aref rkeys (- (length rkeys) 3))
-                          (aref rkeys (- (length rkeys) 2))))
-              (error (progn
-                       (message "which-key error in key-chord handling")
-                       [key-chord])))))
+      (setq this-command-keys (this-single-command-raw-keys)))
     (when (and which-key--god-mode-support-enabled
                (bound-and-true-p god-local-mode)
                (eq this-command 'god-mode-self-insert))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]