zed/crates/which_key
Smit Barmase eba6365025
which_key: Stop grouped rows from hiding keybindings that complete on the next keystroke (#64942)
This has been the behavior since which-key was introduced.

When a key both completed a binding and started longer ones, the
which-key popup and the pending keystrokes indicator folded them all
into one `+N keybinds` row, so there was no way to see what pressing
that key alone would do. For example, with this keymap:

```json
[
  {
    "context": "Workspace",
    "bindings": {
      "space f": "file_finder::Toggle",
      "space f g": "pane::DeploySearch",
      "space f r": "projects::OpenRecent"
    }
  }
]
```

pressing `space` showed `f +3 keybinds`. It now shows `f file finder:
toggle` as its own row, and only the longer bindings are grouped (`f +2
keybinds`). A single longer binding is shown as a regular row.

Group counts also counted duplicate bindings for the same keys when they
weren't next to each other in the list (e.g. `+3` where the next level
only shows 2 rows). Duplicates are now removed before grouping, keeping
the binding key dispatch tries first.

Before:

<img width="200" alt="CleanShot 2026-09-29 at 10 16 01 PM@2x"
src="https://github.com/user-attachments/assets/fe46c218-da7c-431a-bb23-92b0799003ad"
/>

After:

<img width="200" alt="CleanShot 2026-09-29 at 10 15 49 PM@2x"
src="https://github.com/user-attachments/assets/2ce1280a-63bf-4dfc-b589-769dc84c307e"
/>

Release Notes:

- Fixed the which-key popup and pending keystrokes indicator hiding what
a key does when that key also starts longer keybindings.
2026-10-07 09:30:15 +00:00
..
src which_key: Stop grouped rows from hiding keybindings that complete on the next keystroke (#64942) 2026-10-07 09:30:15 +00:00
Cargo.toml which_key: Add a pending key binding indicator (#63343) 2026-09-03 09:35:53 +00:00
LICENSE-GPL