diff options
author | Case Duckworth | 2021-05-05 12:34:21 -0500 |
---|---|---|
committer | Case Duckworth | 2021-05-05 12:34:21 -0500 |
commit | d59ff1f811cba8201ed791102c83e317fe56c1d6 (patch) | |
tree | a84552f531188a9f7a6aaa3a0f9c942c79b40a92 | |
parent | Don't enable a mode just to disable it later (diff) | |
download | emacs-d59ff1f811cba8201ed791102c83e317fe56c1d6.tar.gz emacs-d59ff1f811cba8201ed791102c83e317fe56c1d6.zip |
Remove complicated which-key delay
-rw-r--r-- | init.el | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/init.el b/init.el index f512593..da6623c 100644 --- a/init.el +++ b/init.el | |||
@@ -1042,19 +1042,8 @@ if ripgrep is installed, otherwise `consult-grep'." | |||
1042 | (setup (:straight which-key) | 1042 | (setup (:straight which-key) |
1043 | (:option which-key-show-early-on-C-h t | 1043 | (:option which-key-show-early-on-C-h t |
1044 | which-key-idle-delay 1 | 1044 | which-key-idle-delay 1 |
1045 | which-key-idle-secondary-delay 0.5 | 1045 | which-key-idle-secondary-delay 0.5) |
1046 | which-key-delay-functions '(acdw/which-key-delay-all-but)) | 1046 | |
1047 | |||
1048 | (defun acdw/which-key-delay-all-but (seq len) | ||
1049 | "Delay all `which-key' popups, /except/ the ones here." | ||
1050 | (cond | ||
1051 | ;; With C-z binds (`acdw/leader'), pop up right away | ||
1052 | ((string-prefix-p "C-z" seq :ignore-case) 0) | ||
1053 | ;; Also pop up right away if we're already entering keys | ||
1054 | ((> len 1) which-key-idle-secondary-delay) | ||
1055 | ;; Otherwise, wait | ||
1056 | (t which-key-idle-delay))) | ||
1057 | |||
1058 | (which-key-setup-side-window-right-bottom) | 1047 | (which-key-setup-side-window-right-bottom) |
1059 | (which-key-mode +1)) | 1048 | (which-key-mode +1)) |
1060 | 1049 | ||