mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-25 01:50:11 +01:00
00def035de
Follow-up #63343 Depends on #64859 The pending keystrokes indicator lists the bindings that can complete a chord, but only on hover. This PR adds `which_key::ShowPendingBindings`, bound to `alt-/`, which opens that list from the keyboard while a chord is pending. For example, press `cmd-k` (`ctrl-k` on Linux/Windows), then `alt-/`. The list opens without moving focus and stays open until the chord completes or is cleared, even if the pointer moves away. It follows the chord as you type, and timed chords stay paused while it's open. With no chord pending, `alt-/` does nothing. **Why `alt-/`?** `/` shares a key with `?`, which is a common "help" key, and `alt-/` isn't bound in any default or base keymap. When no chord is pending, `alt-/` behaves as before. It only opens this popup while a chord is pending. On macOS, `alt-/` normally types `÷`, and it still does when no chord is pending. The shortcut only kicks in mid-chord. The one thing we lose is that `cmd-k` then `alt-/` used to cancel the chord and type `÷`, and now it opens the popover instead. I think that's rare enough to be okay, and the key can be rebound or unbound. It can be unbound or rebound to another key. One limitation is that it must be bound to a single keystroke. A multi-keystroke binding would need its own pending tracking on top of the chord that's already pending, and we don't want to add a special pending state just for this. https://github.com/user-attachments/assets/0a26b0ad-cd7b-49d9-b466-cce54e02bf80 Release Notes: - Added `alt-/` to show the bindings that can complete a pending multi-keystroke shortcut.