From badfb8d31f2a03d0e3d996897bb93779003f4607 Mon Sep 17 00:00:00 2001 From: Sanisa Parag Patrikar <149717619+sanisapatrikar@users.noreply.github.com> Date: Sat, 3 Oct 2026 01:26:05 +0000 Subject: [PATCH] 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 `` 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 image ### After image ## 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 --- docs/theme/plugins.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/theme/plugins.js b/docs/theme/plugins.js index a4d21adaa23..a03b4c7cd25 100644 --- a/docs/theme/plugins.js +++ b/docs/theme/plugins.js @@ -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"); }