justbur / emacs-which-key

Emacs package that displays available keybindings in popup
GNU General Public License v3.0
1.73k stars 87 forks source link

BUG: conflict between which-key-window and avy-goto-char-2. #341

Closed tyoul29 closed 2 years ago

tyoul29 commented 2 years ago

emacs-which-key is a powerful plug to help lazy man like me who can't remember shortcut keys, avy-goto-char-2 is a useful command to make the cursor jump to the position which i want.

My environment: Emacs : v28.1 Doom core : v3.0.0-alpha Doom modules: v21.12.0-alpha

When i press the prefix key g, the which-key-window will pop up. If the cursor position is in the lower half of the screen, the curretn-cursor-line will move up to the sum of popup window height and a constant height. This event will change screen content, then i press the rest of key ss(avy-goto-char-2), and follow by 2 char, zero match.

It was a painful experience. Is there a good way to solve the pop-up window change the content of the screen?

justbur commented 2 years ago

Just using which-key, the most straightforward fix might be

(add-to-list 'which-key-inhibit-regexps "^g")

This will prevent which-key from showing on a prefix starting with g.

tyoul29 commented 2 years ago

Thanks, it's a good idea, but my prefix-key is not g. I use avy-goto-char-2 with leader-key.

Ignore leader-key will cause a lot of inconvenience.

I have used package:which-key-posframe, it's perfect! Sadly, i also use termux-app in Android, it doesn't support terminal.

And i make a mistake when i was a noob: (setq which-key-idle-delay 0.1), it's too fast.

Just (setq which-key-idle-delay 0.8). This can solve the problem to a great extent.