Remove complicated which-key delay

This commit is contained in:
Case Duckworth 2021-05-05 12:34:21 -05:00
parent 47304ba506
commit d59ff1f811
1 changed files with 1 additions and 12 deletions

13
init.el
View File

@ -1042,19 +1042,8 @@ if ripgrep is installed, otherwise `consult-grep'."
(setup (:straight which-key)
(:option which-key-show-early-on-C-h t
which-key-idle-delay 1
which-key-idle-secondary-delay 0.5
which-key-delay-functions '(acdw/which-key-delay-all-but))
which-key-idle-secondary-delay 0.5)
(defun acdw/which-key-delay-all-but (seq len)
"Delay all `which-key' popups, /except/ the ones here."
(cond
;; With C-z binds (`acdw/leader'), pop up right away
((string-prefix-p "C-z" seq :ignore-case) 0)
;; Also pop up right away if we're already entering keys
((> len 1) which-key-idle-secondary-delay)
;; Otherwise, wait
(t which-key-idle-delay)))
(which-key-setup-side-window-right-bottom)
(which-key-mode +1))