which_key: Improve pending keystrokes indicator to include untimed chords (#64362)
Closes #64338 The pending keystrokes indicator now shows chords without a timeout, with no countdown circle. For example, pressing `cmd-k` shows that Zed is waiting for another key. Few cases which needed special handling for untimed chords case: - Hovering already pauses a timed chord, and GPUI preserves that pause when the chord advances. An untimed chord has no paused timeout to carry forward. We pause its newly created timeout if the pointer is still over the indicator or popover. - For timed chords, the timeout already stays paused during the popover's 300 ms dismissal delay. If an untimed chord gains a timeout during that delay, it now follows the same rule. The popover still closes at the original deadline, then the timeout resumes with a full second remaining. <img width="308" height="182" alt="CleanShot 2026-09-17 at 11 45 33 AM@2x" src="https://github.com/user-attachments/assets/9baa5fde-de9b-447d-9b02-b712a3065685" /> Release Notes: - Improved the pending keystrokes indicator to show chords without a timeout, such as shortcuts starting with `cmd-k`.
This commit is contained in:
1 parent
20d55798db
commit
890edba9ce
7 files changed
+297
-63
No files matched your search
@@ -177,7 +177,7 @@ When this happens, and both bindings are active in the current context, Zed will
|
||||
|
||||
Zed can also wait before inserting printable text when it might begin a multi-stroke binding. For example, with a `j k` binding, typing `j` waits briefly for `k`; otherwise, `j` is inserted after the timeout.
|
||||
|
||||
Whenever pending input has a timeout, a countdown indicator with the pending keystrokes is shown in the status bar. Hovering it lists the bindings that could still match and pauses the timeout so you can read them. The timeout resumes with the same remaining duration when the pointer leaves. The indicator can be hidden with `{"status_bar": {"pending_keystrokes_indicator": false}}`. Vim and Helix modes continue to use their existing pending-key indicator instead.
|
||||
Whenever multi-stroke input is pending, an indicator with the pending keystrokes is shown in the status bar. Hovering it lists the bindings that could still match. If the input has a timeout, the indicator also shows a countdown, and hovering pauses the timeout so you can read the bindings. The timeout resumes with the same remaining duration when the pointer leaves. Without a timeout, the pending keystrokes are shown without a countdown. The indicator can be hidden with `{"status_bar": {"pending_keystrokes_indicator": false}}`. Vim and Helix modes continue to use their existing pending-key indicator instead.
|
||||
|
||||
To also use the larger which-key menu, open the Settings Editor and search for
|
||||
`Show Which-key Menu`. The pending keystrokes indicator remains visible when the
|
||||
|
||||
@@ -2036,7 +2036,7 @@ Positive `integer` value between 1 and 32. Values outside of this range will be
|
||||
- `cursor_position_button`: Whether to show the cursor position button (clicking it opens the go-to-line/column input)
|
||||
- `line_endings_button`: Whether to show the active line endings button (clicking it opens the line-ending selector)
|
||||
- `active_encoding_button`: When to show the active encoding button: `"enabled"`, `"disabled"`, or `"non_utf8"` (only for encodings other than UTF-8 without BOM)
|
||||
- `pending_keystrokes_indicator`: Whether to show an indicator with a countdown while timed multi-stroke input is pending. Hovering the indicator pauses the timeout. Its binding preview popover is disabled when the which-key popup is enabled (see [key bindings](../key-bindings.md#precedence))
|
||||
- `pending_keystrokes_indicator`: Whether to show an indicator while multi-stroke input is pending. If the input has a timeout, a countdown is shown and hovering the indicator pauses it. Its binding preview popover is disabled when the which-key popup is enabled (see [key bindings](../key-bindings.md#precedence))
|
||||
|
||||
There is an experimental setting that completely hides the status bar. This causes major usability problems (you will be unable to use many of Zed's features), but is provided for those who value screen real-estate above all else.
|
||||
|
||||
|
||||
@@ -361,9 +361,10 @@ TBD: Centered layout related settings
|
||||
// If set to "non_utf8", the button is hidden only for UTF-8 without BOM.
|
||||
// Defaults to "non_utf8".
|
||||
"active_encoding_button": "non_utf8",
|
||||
// Show/hide an indicator with a countdown while timed multi-stroke
|
||||
// input is pending. Hovering it pauses the timeout. Unless the which-key
|
||||
// menu is enabled, hovering also lists the bindings that could still match.
|
||||
// Show/hide an indicator while multi-stroke input is pending.
|
||||
// If the input has a timeout, a countdown is shown and hovering pauses it.
|
||||
// Unless the which-key menu is enabled, hovering also lists the bindings
|
||||
// that could still match.
|
||||
// Defaults to true.
|
||||
"pending_keystrokes_indicator": true
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user