mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-19 02:54:11 +00:00
docs: Fix tab-switcher keybindings (#65105)
## Summary Fixes missing keybinding pills in the Tab Switcher documentation on Linux. The keybinding processing in `docs/theme/plugins.js` assumed every `<kbd>` element contained both macOS and Linux variants separated by `|`. Hand-written keybindings such as `ctrl`, `tab`, and `shift` only contain a single value, making them render empty on Linux. This change falls back to the first keybinding when a Linux-specific value is not provided. Also removes the `tab_switcher::ToggleAll` keybinding reference from the documentation, since the action does not have a default keybinding. Closes #65087. ### Before <img width="1890" height="942" alt="image" src="https://github.com/user-attachments/assets/e3d1298e-2e4f-404f-9f64-74e04d53a27f" /> ### After <img width="1600" height="797" alt="image" src="https://github.com/user-attachments/assets/7a3ef09b-0125-4184-8352-bdd174839720" /> ## Testing - Ran the Zed documentation locally with `mdbook serve docs`. - Verified the Tab Switcher documentation on Linux. - Confirmed that single-sided keybindings (`ctrl`, `tab`, `shift`, etc.) now render correctly. - Confirmed that keybindings containing both macOS/Linux variants continue to render correctly. - Confirmed the `ToggleAll` entry no longer displays the 'no default binding' message. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [ ] Tests cover the new or changed behavior. Release Notes: - N/A --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
This commit is contained in:
parent
3fec483014
commit
badfb8d31f
1 changed files with 3 additions and 1 deletions
4
docs/theme/plugins.js
vendored
4
docs/theme/plugins.js
vendored
|
|
@ -30,7 +30,9 @@ function updateKeybindings() {
|
|||
const isMac = os === "Mac" || os === "iOS";
|
||||
|
||||
function processKeybinding(element) {
|
||||
const [macKeybinding, linuxKeybinding] = element.textContent.split("|");
|
||||
const [macKeybinding, linuxKeybinding = macKeybinding] =
|
||||
element.textContent.split("|");
|
||||
|
||||
element.textContent = isMac ? macKeybinding : linuxKeybinding;
|
||||
element.classList.add("keybinding");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue