The annotation and form-filling surface is being dropped, so remove it
end to end rather than leave it half-maintained.
pdf_viewer loses the editing APIs and everything only they used:
add_ink_annotation, add_highlight_annotation, delete_annotation,
apply_form_edits, the form widget and annotation extraction, the
PdfFormWidget/PdfFormEdit/PdfAnnotation types, the document
serialization helper, and the pdfium guards and constants those
functions were the sole users of. Rendering, text, links, outline and
metadata are untouched; annotation rendering stays on because it paints
markup already embedded in viewed documents.
image_viewer loses the tool palette, form widget overlays, inline form
editors, pen canvas, option menus, the annotate toolbar button, the
Undo Edit and Delete Annotation actions and their key bindings, plus
the associated state and handlers. Text selection, find, links,
thumbnails, outline, properties, rotation, presentation and Save a Copy
remain.
Sweep every user-visible product string to Gwen: app menus (Quit,
Hide, Gwen Repository), feedback links (repo/issues now point at
github.com/kk376/zed, email to yenru@yrkaierx.com), move-to-Applications
and update dialogs, provider and settings copy, CLI help, installer and
desktop/flatpak/snap/plist metadata.
Rename user-facing settings values with back-compat aliases: base_keymap
"Gwen" (accepts "Zed"), fonts ".GwenMono"/".GwenSans" (accept
".ZedMono"/".ZedSans"), icon theme "Gwen (Default)". Fix F10
app-menu keymap arguments to "Gwen" and align the Windows installer
AppMutex with release_channel::app_identifier(). Internal identifiers,
wire protocol names, upstream service URLs and legal attribution are
intentionally kept.
Bundle Gwen Dark (Hallowed Night) and Gwen Light in assets/themes/gwen,
derived from the champion's canon palette: hallowed mist cyan for
accents/functions, Gwen blue for types, violet for keywords, Camavor
gold for constants, pink-stitching rose for properties, mist mint for
strings over a Black Mist night base.
Set Gwen as the default theme pair in settings and the shipped settings
templates, surface it as the first tile in the onboarding theme picker
and the theme preview gallery, and guard the family with a bundled
theme regression test.
- Every committed document edit (annotations and form entries) pushes the
previous state onto a bounded history, so ctrl-z, the annotation
palette's Undo button, and the context menu's "Undo Edit" walk back
through them; undoing past the first edit returns to the file's bytes.
- Right clicking an annotation offers "Delete Annotation". The engine
lists a page's markup annotations (links, widgets, and popups are
excluded) and removes the one under the pointer by its annotation index.
- The palette's Undo button is disabled while the history is empty, and
every edit clears the annotation cache that hit testing reads.
- Selections are character ranges backed by pdfium character boxes,
fetched per page on demand and cached, so a drag stops mid-word and
copy yields the exact substring.
- Double clicks select the word under the pointer and right clicks
outside the selection select the word before opening the context menu.
- Highlight runs merge neighbouring characters on a line, keeping the
painted quad count low, and margins clicks resolve to the nearest glyph.
- Saving a copy of the document is available from the toolbar, the
context menu, and ctrl-s; picking the opened file itself is a no-op.
Chrome-parity navigation work for the PDF viewer:
- Find in document (ctrl-f): query editor, match counter, Enter/Shift+Enter
and ctrl-g navigation, yellow highlights with a stronger tint on the
active match, and a page jump per match.
- Internal link destinations: pdfium now reports dest_page for GoTo links,
so clicking a link that points inside the document jumps to that page
instead of being dropped.
- Space/Shift+Space scroll the viewport a screen at a time, unless the
find bar has focus so the query stays typeable.
## Objective
Allow custom terminal path regexes to extend inherited entries without
copying them. This PR also corrects the existing mismatch between the
documented and shipped default regexes.
This is the last submission in the #64399 series, following #62769,
#64222, #64440, #64484, and #64540.
## Solution
The `"..."` entry is intentionally supported at the top level only. A
`"..."` line inside a multiline entry remains regex text. Existing
configurations that use bare `...` as a three-character regex can
preserve that behavior by writing `["..."]` as an entry instead.
The shipped regexes and hyperlink matching behavior are unchanged.
## Testing
All focused tests and all hyperlink tests pass on macOS. The documented
default expressions were checked against the shipped values.
## Self-Review Checklist:
- [x] I’ve reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
---
Release Notes:
- Added support for `"..."` in `terminal.path_hyperlink_regexes` to
extend inherited regexes without repeating them.
## Objective
Group the threads sidebar settings together in JSON and the Settings
Editor, using consistent “Threads Sidebar” terminology.
This follows up on #63452 now that #62883 has added configurable default
width, and includes the auto-open setting added since then.
## Solution
- Group `position`, `default_width`, and `auto_open` under
`agent.threads_sidebar`, and display their controls together in
Settings.
- Automatically migrate `agent.sidebar_side`,
`agent.threads_sidebar_default_width`, and
`agent.threads_sidebar_auto_open` across supported settings scopes,
preserving existing nested values.
- Apply changes to the default width immediately, including when the
sidebar was manually resized, and clear the saved width override.
Unrelated settings changes preserve manual sizing.
- Document all three settings, including the previously missing position
entry.
## Testing
The following targeted checks passed on the local changes:
- `cargo test -p migrator nest_agent_threads_sidebar_settings` — 7 tests
passed.
- `cargo test -p sidebar -p workspace -p agent_settings -p gpui_platform
--features gpui_platform/runtime_shaders --lib -- width
threads_sidebar_settings test_open_directory_in_existing_window` — 9
tests passed.
- `cargo fmt --all` completed successfully.
- `git diff --check` passed.
- From `docs`: `npx prettier --check src/reference/all-settings.md
src/ai/parallel-agents.md` passed.
Coverage includes migration precedence and supported scopes, settings
defaults and width limits, manual sizing and resets, persisted widths,
and auto-open behavior.
Full application tests and manual UI testing were not run. Clippy was
not rerun after the final terminology changes.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Improved threads sidebar settings by grouping position, default width,
and auto-open together, and applying default-width changes even after
manual resizing.
## Objective
Let projects and language-specific settings add scopes where edit
predictions are disabled without repeating inherited scopes.
Part of #64399.
## Solution
Extend the `"..."` convention from #62769, #64222, #64440, #64484, and
#64540 to `edit_predictions_disabled_in`. For example, a global
`["comment"]` and a language override of `["string", "..."]` disable
predictions in both scopes.
Inherited scopes are inserted at `"..."`, and duplicates keep their
first occurrence. Omitting the marker replaces the list, `[]` clears it,
and omitting the setting preserves inheritance. The default remains
`[]`.
## Testing
Tested on macOS through settings loading, covering project and
language-specific overrides, inheritance, replacement, and clearing. The
language settings tests passed. Live editor behavior has not been
checked manually.
To check manually, configure global `["comment"]` and a language
override of `["string", "..."]`. Confirm predictions are disabled in
both scopes, then remove `"..."` and repeat with `[]` to check
replacement and clearing.
## Self-Review Checklist:
- [x] I’ve reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
---
Release Notes:
- Added support for `"..."` in `edit_predictions_disabled_in` so project
and language-specific settings can extend inherited scopes.
---------
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
## Objective
Let users and projects add edit prediction exclusion patterns without
repeating defaults or inherited patterns.
Part of #64399.
## Solution
Extend the `"..."` convention from #62769, #64222, #64440, and #64484 to
`edit_predictions.disabled_globs` using `SplicingVec`. Inherited
patterns are inserted at `"..."`, and duplicates retain their first
occurrence. Omitting the marker replaces the list, `[]` clears it, and
omitting the setting preserves inheritance.
Opening an absent setting now initializes it with `["..."]` instead of
clearing inherited patterns, and the selection is located by parsing the
JSON instead of a regex, so a commented-out or nested `"disabled_globs"`
can no longer capture it. Cursor imports append `"..."` like the
`files.exclude` import does, so Zed's sensitive-file defaults survive an
import; empty lists and empty or literal `"..."` entries are dropped,
matching `enabled_patterns`.
## Testing
Tested on macOS with settings merge and loading tests, Cursor import
tests, the UI settings update and selection path (including
commented-out and nested decoy keys), the new `settings_json` key-path
lookup, and Copilot integration coverage.
To check manually, configure custom disabled patterns alongside `"..."`
and confirm that both custom patterns and inherited sensitive-file
patterns remain disabled. Repeat without `"..."` and with `[]` to verify
replacement and clearing. Opening the setting when it is absent should
preserve inherited patterns.
## Self-Review Checklist:
- [x] I’ve reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
---
Release Notes:
- Added support for `"..."` in `edit_predictions.disabled_globs` so
custom patterns can extend inherited exclusions, and fixed "Configure
Excluded Files" selecting the wrong list when a commented-out
`disabled_globs` precedes it.
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Closes#61358
Address the keyboard-navigation portions. Image answers are
intentionally not included. ACP form responses support primitive values
rather than image attachments, and Claude Code's adapter treats the
"Other" answer as text. This PR therefore only partially addresses the
issue.
Release Notes:
- acp: Fixed submitting and navigating ACP elicitation forms with the
keyboard.
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`.
Closes https://github.com/zed-industries/zed/discussions/64266
Opening a folder in an existing window force-opens the Threads Sidebar,
and there is no way to prevent it. `open_paths` called
`MultiWorkspace::open_sidebar` unconditionally on the reused window, so
the sidebar reopened on every such open regardless of whether the user
had closed it.
This adds `agent.threads_sidebar_auto_open`, defaulting to `true` so
current behavior is unchanged. With `false`, the folder still opens in
the existing window, but the sidebar stays closed.
This path is reached when `default_open_behavior` or
`cli_default_open_behavior` is set to `existing_window`.
`open_sidebar` was doing double duty: besides showing the sidebar, it
pinned the workspace being navigated away from so it survives the
switch. When the setting is disabled, `retain_active_workspace` is
called instead, so only sidebar visibility changes.
https://github.com/user-attachments/assets/fc299df0-27e2-4ac6-98cb-d817d5f71d0e
## Tests
Two tests in `multi_workspace_tests.rs` cover both branches: the sidebar
opens by default, and stays closed when the setting is disabled while
the folder still opens in the same window.
Release Notes:
- Added `agent.threads_sidebar_auto_open` to control whether opening a
folder in an existing window also opens the Threads Sidebar
## Objective
The Threads Sidebar opens at a hard-coded 300px and can be resized only
by dragging. `agent.default_width` controls the Agent Panel rather than
the sidebar, leaving no way to configure the sidebar’s preferred width.
## Solution
Add `agent.threads_sidebar_default_width` for the width used when no
user-chosen sidebar width is stored. The value is clamped to the
existing 200–800px drag range. Existing, unresized sidebars follow
settings changes immediately. Double-clicking the divider resets the
sidebar to the configured width and resumes following subsequent
settings changes.
The sidebar previously saved its width whenever any sidebar state
changed, not only when the divider was dragged. `SerializedSidebar` now
records `width_set_by_user`, so settings-driven widths are no longer
persisted. Manually resized widths take precedence until the divider is
reset.
## Testing
- `test_threads_sidebar_default_width` in
`crates/agent_settings/src/agent_settings.rs` covers the default, a user
override, fallback for `null` and an unset field, and preservation of
the Agent Panel width and sidebar position.
- Five width-focused tests in `crates/sidebar/src/sidebar_tests.rs`
cover reset behavior, live settings updates, clamping, legacy-width
restoration, and persistence. They also check that manually resized
widths resist settings changes and that resetting resumes following the
setting.
- To check by hand: set `"agent": { "threads_sidebar_default_width": 360
}`, reset the divider, and confirm the sidebar is 360px wide. Change the
setting and confirm the width updates immediately. Drag it wider,
restart, and confirm the dragged width is kept. Double-click the divider
and confirm it returns to the configured width. Set the value to `5000`
and confirm the untouched sidebar clamps to 800px.
## Self-Review Checklist:
- [x] I’ve reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
---
Release Notes:
- Added `agent.threads_sidebar_default_width` for setting the width of
the Threads Sidebar.
## Objective
`agent.default_width` is described as the Agent Panel’s default width,
but panels docked to the left or right use proportional sizing while
`agent.flexible` is enabled. Because flexible sizing is enabled by
default, double-clicking the outer resize handle restores the default
proportion rather than the configured pixel width. This can make
`agent.default_width` appear to be ignored.
## Solution
Clarify that `agent.default_width` controls the fixed width used when
`agent.flexible` is disabled, while resetting a flexibly sized Agent
Panel restores its default proportion.
Update the default settings comments, settings documentation, Settings
UI description, and visual customization guide. Add `agent.flexible` to
the Agent Panel configuration example and explain how it affects reset
behavior. No sizing behavior changes.
## Testing
- `cargo fmt --all -- --check`
- No runtime testing—the change only updates settings descriptions and
documentation.
## Self-Review Checklist:
- [x] I’ve reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed’s UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- N/A
Closes#45783
`Menu` key or `Shift + F10` shortcut wasn't supported in project panel
for opening the context menu, this PR fixes it.
Release Notes:
- Added an action and default keyboard shortcuts to open the context
menu in the project panel. You can now bind
`project_panel::OpenContextMenu` to deploy the context menu at the
currently selected entry in the panel.
---------
Co-authored-by: MrSubidubi <finn@zed.dev>
Release Notes:
- Added button tu prevent idle sleep during AI response streaming
**Context / Motivation:**
When an AI agent takes a long time to generate a response, the operating
system might enter an idle sleep (or display sleep) state if there is no
user interaction (mouse or keyboard). This can interrupt the workflow.
This PR aims to prevent the system from sleeping during an active AI
turn by invoking native OS APIs, and provides a UI toggle for users to
control this behavior.
**Key Changes:**
1. **Cross-Platform Idle Sleep Prevention in GPUI (`gpui`, `gpui_*`)**
- Added a new `prevent_idle_sleep` method to the `Platform` trait. It
returns a RAII-based `PreventIdleSleepToken`, which automatically
restores the original sleep policy when dropped.
- **macOS**: Utilizes `NSProcessInfo`'s `beginActivityWithOptions` with
`NSActivityIdleDisplaySleepDisabled`.
- **Windows**: Uses `SetThreadExecutionState` to prevent display and
system sleep, incorporating a reference counter to handle concurrent
requests safely.
- **Linux**: Uses `ashpd` to request `org.freedesktop.portal.Inhibit`
(inhibiting `Idle` and `Suspend` states) via D-Bus.
2. **AI Agent State Integration (`crates/acp_thread`)**
- Introduced idle sleep prevention logic in `AcpThread`: Acquires the
token at the beginning of `run_turn`, and automatically releases it when
the turn completes normally, errors out, or is explicitly canceled by
the user.
- Added comprehensive unit tests to ensure the token is correctly
acquired and released under various cancellation and concurrency
scenarios.
3. **Settings and UI (`crates/agent_settings`, `crates/agent_ui`)**
- Added `AgentOutputIdleSleepControl` to global state.
- Added a new toggle button (screen icon) to the toolbar at the bottom
of the `ThreadView` (AI conversation panel). Users can hover to view the
tooltip and click to toggle the feature on or off.
<img width="419" height="132" alt="截屏2026-04-04 16 09 08"
src="https://github.com/user-attachments/assets/619da9ff-10f7-46e0-b959-d7c74b16b918"
/>
---------
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Closes#63725
Honor `preview_tabs.enable_preview_from_project_panel` when opening
files with `project_panel::Open` (Space), matching the setting-aware
single-click behavior. Add a regression test covering previews disabled.
Testing:
- `cargo test -p project_panel --lib`
- `cargo build -p zed`
- Manually verified with the setting disabled that Space opens two
permanent tabs
- Manually verified with the setting enabled that Space replaces the
previous preview tab
- `./script/clippy -p project_panel --tests` is blocked by an unrelated
existing `clippy::drain_collect` diagnostic in
`crates/rpc/src/proto_client.rs`
Manual verification:
Preview disabled — Space opens both files as permanent tabs:
<img width="1920" height="1032" alt="Preview disabled: Space opens both
files as permanent tabs"
src="https://github.com/user-attachments/assets/4b772aad-031e-401d-ac85-5a7f82a74bc1"
/>
Preview enabled — Space replaces the previous preview tab:
<img width="1920" height="1032" alt="Preview enabled: Space replaces the
previous preview tab"
src="https://github.com/user-attachments/assets/cfef36af-0cd5-4522-99b5-99d3bb2c3f9d"
/>
Release Notes:
- Fixed the project panel preview-tab setting being ignored when opening
files with the keyboard.
---------
Co-authored-by: Chara <249489759+cmdr-chara@users.noreply.github.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
## Summary
- Add `window_title_format` and `window_title_separator` settings for
customizing the window title
- Expose `${projectName}`, `${fileName}`, `${filePath}`,
`${relativePath}`, `${fileStem}`, `${remoteName}`, `${remoteHost}`,
`${appName}`, and `${separator}` as the native Zed window-title
variables
- Keep the collab `↗/↙` indicator hard-appended
- Translate VS Code `window.title` / `window.titleSeparator` aliases
into Zed's canonical variables during settings import, including
`${appName}` passthrough support and mapping VS Code's
`${activeEditorMedium}` onto Zed's `${relativePath}`
- Gate path-, remote-, and release-channel-derived lookups on whether
the active template references the corresponding variable, so the
default template avoids the extra work and still uses the existing
`last_window_title` cache to skip redundant platform updates
An alternative approach is at #49638. I went with `${variable}` names
over `$ZED_*`, canonical Zed variable names with VS Code aliases handled
at import time, kept `${separator}` as the only structural token, and
left `${dirty}` out of scope.
## Implementation reasoning and notes
### Variables considered but not included
- **collab/shared indicator variable**: kept hard-appended instead.
Folding it into the template would need whitespace/separator logic the
other variables don't need, and I'd rather not bake those semantics in
without a concrete need for it.
- **dirty variable**: The glyph choice and interaction with OS-level
edited indicators (like macOS's titlebar dot via `set_window_edited`)
felt like a separate design call I wasn't confident making here.
A separator-style config for each of collab/shared/dirty would solve the
above, but I didn't want to add too many additional settings initially.
### Performance
`update_window_title` is on a hot path, so two short-circuits apply:
- Path-, remote-, and release-channel-derived lookups (`absolute_path`,
relative-path string, `file_stem`, `remote_connection_options`,
`ReleaseChannel::try_global`) are gated on `template.contains(...)` via
`WindowTitleNeeds::from_template`, so the default template avoids the
extra work.
- The existing `last_window_title` cache still skips the platform call
when the rendered title is unchanged.
## Screenshots
Settings Editor entries for `window_title_format` and
`window_title_separator`:
<img width="774" height="324" alt="Settings Editor screenshot"
src="https://github.com/user-attachments/assets/b3378ec7-5649-4de3-9de6-164a42bce3fd"
/>
Customized Zed window titles in AltTab app switcher (remote, local,
empty):
<img width="774" height="324" alt="AltTab app switcher screenshot"
src="https://github.com/user-attachments/assets/a189945e-fc68-41b9-aab9-6dc04d5ef4ab"
/>
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#14534
Release Notes:
- Added configurable window title formatting with `window_title_format`
/ `window_title_separator`, including `${appName}` / `${remoteName}` /
`${remoteHost}` variables and VS Code `window.title` import support
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
# Objective
The project panel doesn't show a file or folder's actual location on
disk anywhere in the UI — you have to rely on the tab title or context
menu ("Copy Path") to find out where a file actually lives, which is
especially unclear for files with the same name in different folders, or
when a project has multiple worktrees.
## Solution
- Adds a tooltip to each file/folder row in the project panel that shows
the entry's path on hover, with the home directory abbreviated to `~`
(via the existing `PathExt::compact()` utility, consistent with how
paths are already displayed elsewhere, e.g. the Recent Projects list).
## Testing
- Manually tested by hovering over files and folders at various nesting
depths in the project panel and confirming the tooltip shows the correct
path.
- Tested with a project both inside and outside the home directory to
confirm the `~` substitution only applies when appropriate.
- Confirmed existing row behavior (selection, click-to-open,
drag-and-drop, right-click context menu) is unaffected by the added
tooltip.
- Reviewers: hover over any row in the project panel and confirm the
tooltip appears after the normal hover delay and shows the expected
path.
- Tested on macOS only — haven't verified on Linux/Windows.
## Self-Review Checklist:
- [ ] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable
## Showcase
<img width="1512" height="871" alt="image"
src="https://github.com/user-attachments/assets/ec86f9ab-0a8e-40f7-b783-8a115203f11d"
/>
- Help others understand the result of this PR by showcasing your
awesome work!
- If this PR includes a visual change, consider adding a screenshot,
GIF, or video
- A before/after comparison is very useful for changes to existing
features!
While a showcase should aim to be brief and digestible, you can use a
toggleable section to save space on longer showcases:
<details>
<summary>Click to view showcase</summary>
My super cool demos here
</details>
---
Release Notes:
- Added a tooltip showing the file path when hovering over files and
folders in the project panel.
---------
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
## Objective
Markdown preview appearance settings are split between root theme
settings and
`markdown_preview`, and Markdown files always open as source editors
even when a user primarily
wants the rendered preview.
## Solution
- Group the Markdown preview font settings under `markdown_preview`,
migrate their legacy keys
across supported settings scopes, and update defaults, Settings UI, and
documentation.
- Add `markdown_preview.open_markdown_files_in_preview`, defaulting to
false. When enabled, clean
Markdown opens are replaced by a rendered preview while preserving dirty
editors, temporary-tab
behavior, pane activation and focus, targeted navigation, workspace
restoration, and the escape
back to source.
## Testing
- Manually verified on macOS that enabling the setting opens Markdown
files as preview-only.
- `cargo test -p markdown_preview` (three consecutive runs)
- `cargo test -p migrator nest_markdown_preview`
- `cargo test -p settings_content`
- `cargo check -p markdown -p markdown_preview -p migrator -p settings
-p settings_content -p settings_ui -p theme_settings -p workspace`
- `./script/clippy -p gpui_apple -p markdown -p markdown_preview -p
migrator -p settings -p settings_content -p settings_ui -p
theme_settings -p workspace --features gpui_apple/runtime_shaders`
- `cargo fmt --all -- --check`
- `git diff --check`
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Recordings
https://github.com/user-attachments/assets/032ab36d-f934-4ef7-aa18-53f3955a7df8https://github.com/user-attachments/assets/dc872265-2fe0-45ac-95eb-ff820d3a8164
Release Notes:
- Added a setting to open Markdown files directly in preview mode and
grouped Markdown preview settings together.
# Objective
Add an optional smooth cursor movement animation to make cursor position
changes easier to follow, especially during larger jumps and
multi-cursor editing.
Related to #4991.
## Solution
- Add a new `cursor_animation.enabled` editor setting, disabled by
default.
- Animate local bar and block cursors using a damped spring while
preserving momentum during rapid cursor movement.
- Support multiple local cursors independently.
- Continue using the cursor color provided by the active theme.
- Snap immediately when scrolling, resizing, or other viewport changes
would make interpolation misleading.
- Respect the `reduce_motion` setting.
- Request animation frames only while an enabled cursor animation is
active.
Enabling the feature causes additional editor redraws while the cursor
is moving, so it is opt-in and the performance cost is mentioned in the
setting documentation.
### Attribution
The cursor spring physics and four-corner deformation algorithm are
adapted from
[vscode-neovide-cursor](https://github.com/LengineerC/vscode-neovide-cursor),
which is available under the MIT License and inspired by Neovide.
The implementation adapts the algorithm to Zed's editor and GPUI
architecture, including viewport handling, selection state
reconciliation, multi-cursor support, theme integration, and
reduced-motion behavior. The attribution and license information are
also retained in the source file.
## Testing
Automated checks run on Windows:
- `cargo fmt --all --check`
- `cargo test -p editor cursor_animation --lib`
- 15 cursor animation tests passed.
The tests cover:
- Spring convergence.
- Short and long cursor movements.
- Mid-animation retargeting and momentum preservation.
- Multiple independent cursors.
- Selection replacement and state cleanup.
- Viewport and scroll changes.
- Invalid or unusually large timing values.
- Supported cursor shapes.
To test manually:
1. Add the following to the settings file:
```json
"cursor_animation": {
"enabled": true
}
```
2. Move the cursor using typing, arrow keys, mouse clicks, and
multi-cursor actions.
3. Toggle the setting off and confirm that cursor rendering immediately
returns to its normal behavior.
Manual testing was performed on Windows and Linux using a release build
from this exact PR branch.
Verified that:
- Cursor animation is disabled by default.
- Enabling `cursor_animation.enabled` is hot-reloaded without restarting
Zed.
- Disabling the setting immediately restores the original cursor
behavior.
- Cursor movement remains responsive during typing, keyboard navigation,
and mouse navigation.
This exact PR branch has not yet been manually tested on macOS.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
https://github.com/user-attachments/assets/17450529-491e-4982-b539-c46e3d5df467
---
Release Notes:
- Added an optional cursor movement animation setting.
---------
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
# Objective
The Git Panel exposes the `ChangesList` key context while its list is
focused, including when the History tab is active. This causes
Changes-only keybindings to match in History and provides no context for
History-specific bindings.
This is a fresh submission of the revised change from #63669, as
requested in that PR's discussion.
Fixes#61012
## Solution
Select the list key context from the active Git Panel tab. Changes
exposes `ChangesList`, while History exposes `HistoryList`. The shared
`GitPanel` and `menu` contexts remain unchanged.
Preserve compatible keyboard behavior by sharing navigation,
confirmation, and cancellation bindings between `ChangesList` and
`HistoryList` on macOS, Linux, Windows, and Vim. File, staging, restore,
and commit-editor bindings remain exclusive to `ChangesList`.
Extend the dispatch-context test to verify that the list contexts are
mutually exclusive and absent while the commit editor is focused.
## Testing
- `cargo fmt --package git_ui -- --check`
- `./script/check-keymaps`
- `git diff --check`
- `cargo test -p git_ui test_dispatch_context_with_focus_states --
--nocapture`
- `cargo test -p git_ui` (153 passed)
- `cargo build -p zed`
- Manually verified on macOS that History reports `HistoryList` without
`ChangesList`, arrow navigation selects commits, and Enter opens the
selected commit
- Linux and Windows keymaps were updated and checked, but not manually
exercised on those platforms
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
The Keyboard Context view shows `GitPanel`, `menu`, and `HistoryList`
while the History tab is focused. `ChangesList` is absent.

---
Release Notes:
- Fixed Git Panel keybindings matching the Changes tab while the History
tab is active.
# Objective
Fixes#62361.
In the Keymap Editor, focus lands on the "Filter action names" input,
which is wrapped in a `BufferSearchBar` key context
(`crates/keymap_editor/src/keymap_editor.rs`). Its `cmd-alt-f →
text_finder::Toggle` binding (added in #60677) shadows the
`KeymapEditor` context's `cmd-alt-f →
keymap_editor::ToggleKeystrokeSearch`, because `BufferSearchBar` sits
deeper in the focus stack — so `cmd-alt-f` in the filter opens the file
finder instead of toggling "Search by Keystrokes". Same collision on
Linux (`ctrl-alt-f`); Windows is unaffected (it uses `alt-f`).
## Solution
Add a `KeymapEditor > BufferSearchBar` binding mapping the chord back to
`keymap_editor::ToggleKeystrokeSearch`, in `default-macos.json` and
`default-linux.json`. It's more specific than the plain
`BufferSearchBar` binding and placed after the `KeymapEditor` block, so
it wins the same-depth tie-break (gpui precedence: depth, then
definition order) — restoring the shortcut inside the Keymap Editor
without affecting the global text finder.
I gave the `KeymapEditor` binding precedence rather than rebinding
"Search by Keystrokes" to a non-conflicting default (e.g. `cmd-alt-k`),
since it's less invasive and doesn't change a documented default. Happy
to switch to the rebind if the team prefers.
## Testing
Built and ran locally on macOS: opened the Keymap Editor (`cmd-k
cmd-s`), pressed `cmd-alt-f` with focus in the filter → "Search by
Keystrokes" toggles instead of opening the file finder; confirmed the
file finder still works normally in a regular editor. `cargo test -p zed
keymap` passes (validates the bundled keymaps parse and all actions
resolve).
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Tests cover the new/changed behavior (bundled-keymap validation
exercises the new binding; runtime behavior manually verified — no logic
to unit-test in a default-keymap change)
_Unsafe blocks / UI standards / performance: N/A for a keymap default
change._
Release Notes:
- Fixed the Keymap Editor's "Search by Keystrokes" shortcut (`cmd-alt-f`
/ `ctrl-alt-f`) being shadowed by the file finder.
Allows anchoring background images via `background.position`:
`center` (default), `top_left`, `top_right`, `bottom_left`,
`bottom_right`, matching CSS `background-position` semantics.
Also adds `none` to `background.fit` to keep the original image size,
making watermark-style bottom-right or corner positioning possible
without stretching or cover cropping.
Replaces the whole-UI opacity hack with a theme-level surface tint:
- background.opacity now scales the alpha of editor/terminal/panel
surface colors only, so the image shows through the code area while
text, borders, tabs and chrome stay fully opaque and readable
- the image element renders at full opacity behind the workspace
- theme reloads automatically when background settings change
- Move the background image load and decode off the foreground thread
(they were being polled there and tripped hang detection)
- Add background.ui_opacity: scales the opacity of everything drawn on
top of the image so it shows through panels
Adds a workspace background image that renders behind all UI, configured
via a new `background` settings section (path, fit, opacity).
The image is loaded asynchronously with a 2-second timeout and is never
read on the render path, so an unreachable source (e.g. a dead network
mount) cannot block or freeze the workspace. The first successful read is
cached under the data directory (written once, never rewritten), and when
the source is unavailable the cached image is served from that cache, so
the background keeps working offline.
- Render PDF pages on-demand per active page instead of stitching entire document into one giant texture (fixing 22k px Vulkan texture atlas overflow and driver crash).
- Add toolbar navigation buttons (previous, next, page indicator).
- Add keyboard shortcuts (PageUp/PageDown, Left/Right arrows, j/k, Home/End) for page navigation.
- Add status bar metadata for active PDF page index and total page count.
# Objective
- Improve documentation for `close_panel_on_toggle` setting.
## Solution
- Previous docs were a bit ambiguous and since refactoring the setting
name is not possible at the time, I improved the documentation.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable
Release Notes:
- Added the`close_panel_on_toggle` setting to the settings UI and
improved its documentation.
Closes#26430
Complements: #52935 by Jacob Binnie
Enables multi-select in the Git Panel, following the Project Panel
rules.
https://github.com/user-attachments/assets/2892c1e2-3071-47f9-af1a-48e1c69dbb8a
**Core selection gestures:**
1. Click one file, shift+click a file deeper in the list: all files
between highlight.
2. Click one file, then ctrl/cmd+click another file: it joins the
selection; or removes it when selected.
3. Shift+down extends the selection from the current row; shift+up
shrinks it back and re-extends past the anchor.
4. Escape with a selection clears it and keeps focus; Escape again
toggles focus as before.
5. Plain click collapses selection to file and opens its diff;
double-click triggers the alternate open action.
6. Shift+click on a checkbox still performs the pre-existing range
staging.
**Bulk operation gestures:**
1. Select multiple files, press space: if any member is unstaged, all
become staged; press space again: all unstaged.
2. Right-click a file inside the selection: menu reads
Stage/Discard/Trash N files, depending on context.
3. Select multiple files, press delete: confirmation prompt. Mixed
selections: untracked = trashed, staged = unstaged.
**Folders, in tree view:**
1. Ctrl/cmd+click a folder row behaves like its checkbox does: selects
it as a unit, expands operations to descendants.
2. Folder rows inside a shift range join the selection. A collapsed
folder is selected including its hidden files.
3. The same directory under Tracked and Untracked is two independent
selections (so marks are section-qualified).
5. Plain click on a folder still expands/collapses it and clears the
selection.
**Implementation notes:**
1. Selection is stored as repo paths plus section-qualified tree keys to
survive status refreshes.*
2. Stale entries are pruned on rebuild, selection is cleared on active
repository change.
3. Range selection follows visual order in both flat and tree view.
4. Bulk operations batch into a single git operation.
\* Not sure if this is the best option for storing it.
**Why this is necessary**
- Multi-select has been an ongoing feature wish since 2025 with various
upvotes
- Current state of the art IDEs offer this (VSCode, IntelliJ, VS)
- It greatly increases efficiency using the diff panel
**Why is the PR from #52935 not enough?**
This PR builds on its approach. Thanks to @jacobbinnie. But I noticed a
few things:
- never clears the selection when the active repository changes
- a failed checkout or trash disappears silently
- hardcodes single-click = project diff and double-click = file diff,
ignoring the entry_primary_click_action setting
- its context menu still reads "Stage File" / "Discard Changes"
(singular)
- discard prompt always says "Discard" even for an all-untracked
selection that will actually trash files
- no shift+arrow range extension, no Escape to clear
- it skips directory rows entirely, in tree view you can't act on a
folder's subtree at all
- its range_select only ever accumulates, consecutive shift+clicks grow
the set and nothing shrinks it
- Uses Vec<RepoPath> on marks, linear contains scans -> This PR uses
HashSets, relevant for huge repos.
- doesn't ship any tests -> This PR covers the whole range with tests
too*
\* Tests dominate this PR (~850 lines). The actual feature sits around
400.
Release Notes:
- Added multi-select to the git panel
---------
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
Co-authored-by: Jacob Binnie <jacob.b@linktr.ee>
Co-authored-by: Andrea Leone <andrealeone@hey.com>
Closes https://github.com/zed-industries/zed/issues/60242
# Objective
When reviewing a branch diff — or project search results — the outline
panel lists every affected excerpt and symbol beneath each file. On a
diff touching more than a handful of files, this consumes so much
vertical space that you cannot see the list of changed files at all,
which is usually the thing you want the panel for.
Existing settings don't cover this:
- `expand_outlines_with_depth: 0` still renders excerpt rows and
top-level symbol rows.
- Collapsing a file row in the panel is coupled to folding that buffer
in the editor, so it can't be used purely to tidy the panel.
## Solution
A display-only mode that reduces multi-buffer views to just the
directory/file tree.
- New `outline_panel.multi_buffer_hide_symbols` setting (default
`false`). When enabled, multi-buffer views render only directory, file
and folded-directory rows — excerpt, symbol and search-match rows are
hidden.
- New `outline panel: toggle symbols` action, plus a button in the panel
footer, which toggles an in-memory per-panel override of the setting
(the same pattern as `editor: toggle inlay hints`). Changing the setting
clears the override, so the setting wins.
- Single-file views are exempt, and the footer button is not shown there
— the panel contains only symbols in that case, so hiding them would
leave it empty.
- The filter is display-only: `collapsed_entries` and editor buffer
folding are never touched.
- Outline fetching is skipped while the mode is active, so large diffs
don't pay for outlines that will not be rendered. Turning the mode off
re-triggers fetching.
This adds one new icon, `file_code_off`, used by the footer button when
symbols are hidden. cc @zed-industries/design for review per the icon
guidelines — it is `file_code` with the slash and outline gaps from
`file_ignored`, keeping the parts of the chevrons that fall on the near
side of the slash.
## Testing
Three new tests in `crates/outline_panel/src/outline_panel.rs`:
- `test_hide_symbols_in_multibuffer` — outline rows are present by
default; only `Fs`/`FoldedDirs` entries remain once the mode is enabled
via the setting (which also exercises the settings observer) and via the
action; outline rows return when it is toggled off, confirming outlines
are re-fetched; asserts `collapsed_entries` is unchanged at every step,
covering the display-only guarantee.
- `test_hide_symbols_exempts_singleton` — a single-file view still
renders its outline with the setting enabled.
- `test_hide_symbols_hides_search_matches` — project search match rows
are hidden while files and directories still render, and return when
toggled off.
`cargo test -p outline_panel` (15 passing), `cargo test -p icons`,
`cargo test -p settings_ui -p settings_content`, and `./script/clippy`
on the touched crates are all green.
Tested manually on macOS against a branch diff, project search results,
and single-file buffers, checking both the setting and the action (from
the panel footer button and from the command palette with focus outside
the panel), and that expanding/collapsing directories and editor folding
still behave as before.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
<!-- Screenshots go here: branch-diff before/after, footer button icon
states, search before/after, single-file exemption -->
| | Symbols shown (default) | Symbols hidden |
| --- | --- | --- |
| **Footer toggle** | <img
src="https://github.com/user-attachments/assets/393f128d-1a7c-43a8-97b8-8176a07b45c7"
width="260"> | <img
src="https://github.com/user-attachments/assets/87c60dd4-d5b7-48f8-9255-226c4a94a586"
width="260"> |
| **Branch diff** | <img
src="https://github.com/user-attachments/assets/79357325-7d7d-40f7-8067-4ae59a824f87"
width="420"> | <img
src="https://github.com/user-attachments/assets/8a3bbc7e-90d4-4638-9f1d-1ba3091eccfd"
width="420"> |
| **Project search** | <img
src="https://github.com/user-attachments/assets/76e3cf18-d624-42f8-8801-f496bf54a552"
width="420"> | <img
src="https://github.com/user-attachments/assets/2a34e899-b9f4-465e-b571-75d3d54d00eb"
width="420"> |
Single-file views are unaffected — symbols still render, and the toggle
is not offered:
<img
src="https://github.com/user-attachments/assets/76c47884-96db-4071-bcc1-931c4283e36f"
width="640">
---
Release Notes:
- Fixed too many outlines shown per excerpt in the outline panel. Added
an `outline_panel.multi_buffer_hide_symbols` setting and an `outline
panel: toggle symbols` action to show only files and directories in the
outline panel for multi-buffer views.
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
## TL;DR
Adds `cmd-shift-v` / `cmd-k v` (ctrl on linux/windows) to open the
tabular data preview for `csv`/`tsv`/`ssv`/`psv` files, mirroring the
existing `markdown::OpenPreview(ToTheSide)` and
`svg::OpenPreview(ToTheSide)` bindings/context pattern already in the
default keymaps.
Extension check kept explicit (not just `"Editor"`) so it doesn't
compete with the `md`/`svg` blocks bound to the same keys on their own
extensions.
## Testing
- Manually verified `cmd-shift-v` / `cmd-k v` open tabular data preview
on `.csv`/`.tsv`/`.ssv`/`.psv` files, no-op on other extensions.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] UI standards followed
- [ ] Tests cover the new/changed behavior
- [x] Performance impact considered, acceptable
Release Notes:
- Added shortcuts to open the tabular data preview for CSV/TSV/SSV/PSV
files (similar to md/svg preview)
---------
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
# Objective
Originally, `IconName::Filter` was a funnel glyph and
`IconName::Sliders` was used for settings/controls.
In #60937 (commit `1a06fd4f2b`), `filter.svg` was replaced with the
sliders glyph, and `sliders.svg` / `Sliders` enum variants were deleted.
Consequently, `IconName::Filter` has become a sliders-shaped icon used
across 8+ surfaces in Zed (git_ui, search, debugger_ui, keymap_editor,
language_tools, quick_action_bar, editor view settings).
When moving tabular data preview settings to follow the editor's
convention (using `IconName::Filter` sliders for table view settings),
column filter buttons in the table header were left using the same
sliders icon instead of a traditional funnel.
Repurposing `IconName::Filter` back to a funnel would break all other UI
surfaces across Zed.
## Solution
- Restored the funnel icon under a new dedicated
`IconName::FilterFunnel` variant (`assets/icons/filter_funnel.svg` and
`crates/icons/src/icons.rs`).
- Updated `tabular_data_preview` column filter trigger buttons
(`table_header.rs`) to use `IconName::FilterFunnel`.
- Left all existing `IconName::Filter` (sliders) usages across the app
untouched.
Before:
<img width="363" height="156" alt="image"
src="https://github.com/user-attachments/assets/84ac5f87-c0f7-4de9-94ea-e4040e3b4a4a"
/>
After:
<img width="361" height="151" alt="image"
src="https://github.com/user-attachments/assets/38514f3a-0710-4273-b227-4623bf78410b"
/>
## Testing
- `cargo check -p icons -p tabular_data_preview` and `./script/clippy`
build clean.
- `cargo test -p tabular_data_preview --lib` passes.
- Verified column filter button renders the funnel icon in tabular data
preview and highlights correctly when filters are active.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Replace column filter icon in tabular data preview with filter funnel
# Objective
Closes#4868.
Reintroduce automatic language detection for user-created untitled
buffers without allowing it to override language choices made by users
or owning surfaces.
More details:
+ https://github.com/zed-industries/zed/pull/61201
+ https://github.com/zed-industries/zed/pull/61351
## Solution
VS Code distinguishes between inferred and explicitly selected
languages, and only continues automatic detection in the former state.
This change introduces a buffer-local opt-in flag with the same purpose.
It defaults to disabled and is enabled only for user-created untitled
buffers and restored untitled buffers that did not persist a language.
Choosing a language through the language picker disables detection,
while automatically detected languages remain eligible for later
redetection. Buffers whose language is assigned by their owning surface,
such as Channel Notes, never opt in.
Rather than adding persisted state or changing the database schema,
restoration reuses the existing optional serialized language. An
opted-in buffer that remains Plain Text is serialized without a language
and resumes detection after restoration. Once automatic detection has
selected a language, that language is serialized normally and
restoration leaves detection disabled, effectively treating it as an
explicit selection. This also matches VS Code's effective default after
restoration.
Candidate selection adopts VS Code's confidence-group filtering. Results
below the minimum confidence are discarded, and candidate groups are
accepted only after a clear confidence gap. The detector then selects
the first available Zed language without eagerly loading every
candidate. I then added a separate switching rule: Zed keeps the current
language unless another candidate has a clear confidence advantage,
reducing language changes as model scores fluctuate during editing.
Model inference runs off-thread on a bounded sample, and stale results
are discarded.
I also evaluated penalizing YAML and using stricter global switching
thresholds, but neither reliably resolves the ambiguity between Markdown
and YAML. In the reproduction from #61351, Betlang assigns YAML more
than 80% confidence during editing and peaks around 90%. This is
reasonable from the content alone: `#` denotes a YAML comment, while `-`
denotes a sequence item. Adding ordinary prose or a fenced code block
shifts the model strongly toward Markdown. A fixed penalty would overfit
this example and risk suppressing legitimate YAML detection. Since
known-language buffers do not opt in and manual language selection takes
precedence, I consider this level of ambiguity acceptable and prefer not
to introduce language-specific score tuning.
Model inference itself is fast. As noted in #61201:
> In release builds on Linux with an Intel Core i5-13600KF, the
`betlang::detect` call alone typically completes within 3 ms when
processing the maximum sampled input.
The main concern is the work surrounding inference. Without debouncing,
rapid typing creates a snapshot and launches a background detection task
on every keystroke, while the detected language may change before the
user has finished typing. This change therefore adds a 200 ms debounce
delay, allowing detection to run and update the language only after the
user pauses.
## Testing
Automated coverage verifies that short inputs remain Plain Text,
sufficient Rust content is detected as Rust, replacing it with Go
content triggers redetection, and manually selecting Plain Text prevents
subsequent automatic changes. Restoration coverage verifies that a
stored language keeps detection disabled, while an empty language-less
untitled buffer resumes detection.
Beyond the automated tests, I manually tested automatic language
detection while editing untitled buffers.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
https://github.com/user-attachments/assets/103fc731-e12e-48d6-ae89-03978f1c9d74
---
Release Notes:
- Added automatic language detection for untitled buffers.
---------
Co-authored-by: Max Stevens <maxstevens2708@gmail.com>
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
# Objective
Fixes#12572
## Solution
- Adds an opt-in `reveal_if_open` setting which enables searching and
revealing an already open buffer
- Ensures this only happens if there is no pane target for the open
intent
## Testing
- Built for and tested on my Mac
- Tests added covering the scope of the feature
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
https://github.com/user-attachments/assets/cdcc78cd-85fd-4b56-b562-feba375ecd03
---
Release Notes:
- Added configuration to reveal buffers already open in a different pane
instead of the active pane, via `reveal_if_open`
---------
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>