4057b1e
Final clean up
Anthony Eid created
4057b1e
Final clean up
Anthony Eid created
3f4f365
Fix clippy
Anthony Eid created
7a83411
Revert list height change
Anthony Eid created
90fc098
combine resize handle renderers
Anthony Eid created
731b710
Share more of the Table::render code for both resize column states
Anthony Eid created
469ee78
Unify on drag types
Anthony Eid created
4a5f470
Simplify some code
Anthony Eid created
9fae86d
Start work on combining both header states
Anthony Eid created
8c2586c
fix: Fix diagonal scroll on horizontal scrolling
HalavicH created
141b75e
fix: Update the variable list mode with measuring of all rows
HalavicH created
1774735
fix: Move scrollbar to the right edge of the screen & fix diagonal scroll
HalavicH created
3d0adb1
fix: Update the scrollbar selection in different render mode
HalavicH created
47318f2
fix: Update the line height for variable list mode
HalavicH created
43762a6
fix: Resize handles
HalavicH created
3341af7
fix: Horizontal scrolling
HalavicH created
5614240
feat: Update CSV preview with resizable column
HalavicH created
4cca593
feat: Implement resizeable columns
HalavicH created
818991d
tasks_ui: Fix previously used task tooltip (#53104)
Closes #52941 ## Summary - update the task picker delete button tooltip to describe the recently used task entry it removes - keep the change scoped to the inaccurate user-facing copy in the tasks modal ## Testing - cargo test -p tasks_ui Release Notes: - N/A
Saketh created
6f7fab1
http_client: Fix GitHub download unpack failures on some filesystems (#53286)
Disable mtime preservation when unpacking tar archives, as some filesystems error when asked to set it. Follows how [cargo](https://github.com/rust-lang/cargo/blob/1ad92f77a819953bcef75a24019b66681ff28b1c/src/cargo/ops/cargo_package/verify.rs#L59 ) and [uv](https://github.com/astral-sh/uv/blob/0da0cd8b4310d3ac4be96223bd1e24ada109af9e/crates/uv-extract/src/stream.rs#L658) handle it. > Caused by: 0: extracting https://github.com/microsoft/vscode-eslint/archive/refs/tags/release%2F3.0.24.tar.gz to "/Users/user-name-here/Library/Application Support/Zed/languages/eslint/.tmp-github-download-pYkrYP" 1: failed to unpack `/Users/user-name-here/Library/Application Support/Zed/languages/eslint/.tmp-github-download-pYkrYP/vscode-eslint-release-3.0.24/package-lock.json` 2: failed to set mtime for `/Users/user-name-here/Library/Application Support/Zed/languages/eslint/.tmp-github-download-pYkrYP/vscode-eslint-release-3.0.24/package-lock.json` 3: No such file or directory (os error 2) 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 Release Notes: - N/A
Smit Barmase created
24a6008
repl: Improve iopub connection error messages (#53014)
Coming from #51834, these would be more helpful than just that it failed! 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 Release Notes: - N/A
MostlyK created
2aa1559
agent_ui: Add padding to markdown output in card layout (#53194)
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 #53191 Release Notes: - Added padding to markdown output when rendered in card layout. Before: <img width="627" height="437" alt="Screenshot 2026-04-01 at 3 32" src="https://github.com/user-attachments/assets/6fbd31f0-80b5-4c63-b9a4-d151bd28cf31" /> After: <img width="666" height="400" alt="Screenshot 2026-04-05 at 4 47 38 PM" src="https://github.com/user-attachments/assets/3128532a-bfcf-4308-aec5-3981201001ab" />
Markos Narinian created
092c705
vim: Fix % for multiline comments and preprocessor directives (#53148)
Implements: [49806](https://github.com/zed-industries/zed/discussions/49806) Closes: [24820](https://github.com/zed-industries/zed/issues/24820) Zeds impl of `%` didn't handle preprocessor directives and multiline To implement this feature for multiline comment, a tree-sitter query is used to check if we are inside a comment range and then replicate the logic used in brackets. For preprocessor directives using `TextObjects` wasn't a option, so it was implemented through a text based query that searches for the next preprocessor directives. Using text based queries might not be the best for performance, so I'm open to any suggestions. Release Notes: - Fixed vim's matching '%' to handle multiline comments `/* */` and preprocessor directives `#if #else #endif`.
Juan Pablo Briones created
46fc693
vim: Add editor setting for changing regex mode default in vim searches (#53092)
Closes #48007 Release Notes: - Added editor setting for changing regex mode default in vim searches Summary: - Based on the report in #48007 and the discussion here https://github.com/zed-industries/zed/pull/48127#issuecomment-3838678903 - There was feedback mentioning that vim-mode needs to default vim-searches to use regex-mode (even when the editor regex-search setting is disabled). However, it was suggested that a vim search setting could be configured to adjust this behaviour. - In this PR a new vim setting was added to change whether vim-searches will use regex-mode by default, so now users can can configure vim-search to not use regex-mode when typing the `/` character (or using the vim search command). Screen Captures: https://github.com/user-attachments/assets/172669fb-ab78-41a1-9485-c973825543c5
Sean Hagstrom created
9c5f3b1
terminal_view: Reset cursor blink on `SendText` and `SendKeystroke` actions (#53171)
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) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #53115 Release Notes: - Fixed terminal cursor blink not resetting when navigating with action-bound keys (e.g., alt+left/right on macOS, alt+b/f on Linux) ## Demo ### Before the fix The cursor stays invisible after word-jumping because the blink cycle keeps going without resetting. https://github.com/user-attachments/assets/00dbdba6-d793-4a23-abcc-37887f4d1262 ### After the fix The cursor shows up at the new position right after each word-jump, then blinks again as expected. https://github.com/user-attachments/assets/48d5906c-4899-4f4a-adbd-5908ebea0cfb
João Soares created
3a5dc8e
Restore ACP slash commands when reopening threads (#53209)
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 - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #52239 ## Summary Note - The code in this fix is AI generated. OpenCode ACP chats lost slash-command support after Zed restarted and a thread was reopened. The UI no longer showed `/ for commands`, and slash commands like `/help` were treated as unsupported. ## Root Cause ACP available commands were treated as transient UI state instead of durable thread state. - `AcpThread` handled `AvailableCommandsUpdate` but did not retain the commands on the thread - restored thread views rebuilt `SessionCapabilities` with an empty `available_commands` list - the message-editor placeholder started in the wrong state for restored threads - live command updates could be applied to the wrong thread view ## Fix - persisted `available_commands` on `AcpThread` - restored `SessionCapabilities` from thread state - reused the same command augmentation logic for restore and live update paths - updated live command handling to target the correct thread view - initialized the message-editor placeholder from current command availability - added a regression test for the restore path ## Verification - `cargo test -p agent_ui conversation_view::tests::test_restored_threads_keep_available_commands -- --exact --nocapture` - `./script/clippy -p agent_ui --tests` Release Notes: - Fixed ACP slash commands disappearing after reopening restored threads. --------- Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Yoni Sirote and Ben Brandt created
a018333
Introduce the temporary/retained workspace behavior based on whether the sidebar is open (#53267)
Self-Review Checklist: - [ ] 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 Release Notes: - N/A
Mikayla Maki created
bc4d25c
lsp: Do not pass in null diagnostic identifiers (#53272)
This fixes a crash with new Preview versions of tsgo after https://github.com/microsoft/typescript-go/pull/3313 Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #ISSUE Release Notes: - N/A
Piotr Osiewicz created
fb2bff8
Add allow_empty commits, detached worktree creation, and new git operations (#53213)
Extend the git API with several new capabilities needed for worktree archival and restoration: - Add `allow_empty` flag to `CommitOptions` for creating WIP marker commits - Change `create_worktree` to accept `Option<String>` branch, enabling detached worktree creation when `None` is passed - Add `head_sha()` to read the current HEAD commit hash - Add `update_ref()` and `delete_ref()` for managing git references - Add `stage_all_including_untracked()` to stage everything before a WIP commit - Implement all new operations in `FakeGitRepository` with functional commit history tracking, reset support, and ref management - Update existing call sites for the new `CommitOptions` field and `create_worktree` signature Part 1 of 3 in the persist-worktree stack. These are nonbreaking API additions with no behavioral changes to existing code. Release Notes: - N/A --------- Co-authored-by: Anthony Eid <anthony@zed.dev>
Richard Feldman and Anthony Eid created
5bd78e3
sidebar: Fix space not working in archive view's search editor (#53268)
Similar to https://github.com/zed-industries/zed/pull/52444 but now in the archive view's search editor. Release Notes: - N/A
Danilo Leal created
f0df393
Consolidate prompt formatting logic into `zeta_prompt` (#53079)
Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] 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 #ISSUE Release Notes: - N/A or Added/Fixed/Improved ...
Ben Kunkle created
e2bba55
agent: Fix issue with streaming tools when model produces invalid JSON (#52891)
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 #ISSUE Release Notes: - N/A
Bennet Bo Fenner created
d2257db
compliance: Initialize compliance checks (#53231)
Release Notes: - N/A
Finn Evers created
ec832ca
rules_library: Fix hover selecting active rule (#53264)
Closes https://github.com/zed-industries/zed/issues/53159 Recently, we changed the behavior of pickers so that hovering matches would also select them. This makes sense for most pickers that are used as "regular" pickers, but we have some in Zed that are not. A great example of one is the rules library, which sort of became way less usable with this behavior. So, this PR introduces a simple bool trait method to the picker so that we can turn this behavior off whenever necessary. The rules library kicks off as the only instance of it being turned off. Release Notes: - Fix navigation within the rules library making it so hovering the sidebar doesn't activate the visible rule.
Danilo Leal created
2b4901d
workspace: Handle double-click on pinned tab row empty space (#51592)
When `tab_bar.show_pinned_tabs_in_separate_row` is enabled, double-clicking the empty space on the unpinned tab row creates a new tab, but double-clicking the empty space on the pinned tab row does nothing. Add the same `on_click` double-click handler to the pinned tab bar drop target so both rows behave consistently. Release Notes: - Fixed double-clicking empty space in the pinned tab row not opening a new tab when `show_pinned_tabs_in_separate_row` is enabled. --------- Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
mgabor and Joseph T. Lyons created
7adbee0
sidebar: Fix behavior of "Remove Project" button (#53242)
- Fix an issue where the "remove project" button, available in the header's ellipsis menu, wouldn't do anything if the sidebar contained only one project - Fix another issue where attempting to remove a project when the sidebar has more than one project wouldn't actually remove it. This is fixed by cleaning up the project group keys after its been already removed. Release Notes: - N/A
Danilo Leal created
383b0a7
settings_ui: Recategorize some panel settings (#53243)
Was looking around the panels page in the settings UI and noticed there was a standalone "Auto Open Files" section. That felt a bit out of place because those settings are really project panel-specific. So this PR moves them under the project panels section of the panels page. Release Notes: - N/A
Danilo Leal created
1823be5
agent_ui: Fix "scroll to" buttons (#53232)
Follow-up to https://github.com/zed-industries/zed/pull/53101 In the process of fixing the thread view's scroll experience, we for got to turn off the follow state tail for functions that power the scroll buttons in the agent panel. Release Notes: - N/A
Danilo Leal created
dee4250
dev_container: Preserve build context for docker-compose Dockerfiles (#53140)
When a Docker Compose service specifies a build context, the generated override file was replacing it with an empty context directory. This meant Dockerfiles that reference files relative to their build context (e.g. `COPY . /app`) would fail. The fix preserves the original build context from the compose service, falling back to the empty context directory only when no context was specified. 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 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 Release Notes: - Fixed docker compose Dockerfile build context not being preserved in dev_container integration. --------- Co-authored-by: KyleBarton <kjb@initialcapacity.io>
Peter Siegel and KyleBarton created
136e91a
Fix a bug where legacy threads would be spuriously opened in a main workspace (#53260)
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 Release Notes: - N/A
Mikayla Maki created
d1b1f25
git_graph: Fix commit hover misalignment after fractional scrolling (#53218)
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 #53199 Mathematically, `floor(A) + floor(B) != floor(A + B)`. The original code calculated the hovered row by applying `.floor()` to the scrolled offset and local offset separately before adding them together, which incorrectly dropped fractional sub-pixels and caused an off-by-one targeting error. Release Notes: - N/A --------- Co-authored-by: Anthony Eid <anthony@zed.dev>
Xin Zhao and Anthony Eid created
7d8fe66
workspace: Keep restricted mode modal actions visible (#53124)
Closes #52586 ## Summary - cap the restricted project list height inside the security modal and make it scroll - cap the modal body content height so the action buttons stay reachable on smaller screens - add a regression test that reproduces the overflow scenario with many restricted projects in a constrained window ## Validation - manually reproduced the overflow by opening 60 untrusted projects in a 720x620 window before the fix - cargo test -p workspace test_security_modal_project_list_scrolls_when_many_projects_are_restricted - cargo check -p workspace Release Notes: - Fixed restricted mode dialogs overflowing past the window when many unrecognized projects are open. --------- Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Saketh and Danilo Leal created
909f6d1
dev_container: Make volumes key and source key in volume mounts optional (#53137)
Fixes some issues concerning volume mounts in the `dev_container` integration: 1. Docker Compose services that don't define a volumes key cause deserialization to fail because the field was required. This field is not strictly necessary, i.e. for other services in a docker compose devcontainer configuration which the editor is not attached to. 1. Volume mounts where source or target is absent (e.g. `tmpfs` mounts that only need a target) also fail to parse because both fields were required. This makes the source key optional, matching the Docker Compose spec. 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 Release Notes: - Fixed devcontainer initialization erroneously requiring each service to have a volumes key. - Fixed devcontainer initialization erroneously requiring source keys for all volume mounts. --------- Co-authored-by: KyleBarton <kjb@initialcapacity.io>
Peter Siegel and KyleBarton created
d22f8bf
Make `zed foo/` add to active window and open sidebar (#53254)
Changes the default CLI behavior when opening directories: - `zed foo/` now adds `foo/` as a new workspace in the active window's MultiWorkspace and opens the sidebar, instead of creating a new window. If `bar/` was previously open, both `foo/` and `bar/` are retained as separate workspaces in the sidebar. - `zed -n foo/` continues to open a new window without the sidebar (unchanged behavior). - `zed -a foo/` continues to add to the existing workspace (unchanged behavior). The new behavior is gated on `multi_workspace_enabled` (the `agent-v2` feature flag). Without the flag, directories open in a new window as before, avoiding a situation where the workspace gets replaced with no sidebar to switch back. The change is contained to `open_paths()` in `crates/workspace/src/workspace.rs`. When no CLI flag is specified and no existing workspace matches the paths, we now look for the active window and set `requesting_window` so that `Workspace::new_local` adds the new workspace to it rather than creating a new window. Release Notes: - N/A
Eric Holk created
7748047
git_graph: Refresh UI when stash/branch list has changed (#53094)
### Summary This PR fixes an issue where the git graph wouldn't refresh its state correctly unless HEAD changed. Now repository emits events when the branch list has changed, and invalidates the graph data cache when the stash or branch list has changed. I also renamed the event `Repository::BranchedChanged` to `Repository::HeadChanged` as well. 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 #53080 Release Notes: - N/A or Added/Fixed/Improved ...
Anthony Eid created
4b1e0a3
dev_container: Parse env vars and docker labels with `=` in values correctly (#53134)
Fixes a parsing issue where docker env var key/value pairs can contain an "=" character in the value. This is pretty common and present in all [nvidia/cuda](https://hub.docker.com/r/nvidia/cuda) docker images. Also adds some tests for env var parsing. 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 Release Notes: - Fixed a parsing failure where docker env var key/value pairs can contain an "=" character in the value.
Peter Siegel created
1d0967c
Fix compilation on main (#53257)
Semantic merge conflict due to multibuffer API 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 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 Release Notes: - N/A
Cole Miller created
f3c034e
Prevent dev container modal dismissal during creation (#52506)
## Context When the dev container creation modal is showing "Creating Dev Container", clicking anywhere on the workspace backdrop dismisses the dialog. The container creation continues in the background, but the user loses visual feedback and the subsequent `open_remote_project` call may fail because the modal entity is gone. This adds an `allow_dismissal` flag to `RemoteServerProjects` that blocks accidental dismissal (backdrop clicks, focus loss) while a dev container is being created, but allows explicit dismissal on success or error. ## How to Review Small PR — two files changed: 1. **`remote_servers.rs`** (the fix): `allow_dismissal` bool field added, set to `false` when entering Creating state, set to `true` before emitting `DismissEvent` on success/error. `on_before_dismiss` override checks the flag. 2. **`recent_projects.rs`** (the test): Regression test that opens a dev container modal, simulates a backdrop click, and asserts the modal stays open. ## 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 Release Notes: - Fixed dev container creation modal being dismissed when clicking outside it --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Toni Alatalo and Claude Opus 4.6 created
a92b242
keymaps: Add Ctrl+R open recent binding for macOS and Linux (#52893)
Closes #52879 ## Summary VS Code binds `Ctrl+R` to open recent workspaces/folders on all platforms (Windows, macOS, and Linux). Zed already had this binding in `default-windows.json`, but it was missing from `default-macos.json` and `default-linux.json`. Since `BaseKeymap::VSCode` returns no supplemental keymap file and relies entirely on the platform default keymaps, users who selected VS Code keybindings on macOS or Linux would not get the expected `Ctrl+R` behavior — instead getting nothing, or having to use the non-VSCode binding (`Alt+Cmd+O` / `Alt+Ctrl+O`). This adds the missing binding to both platform defaults, consistent with what Windows already had. ## Screenshot The default keybinding in VS Code: <img width="1512" height="319" alt="Screenshot 2026-04-01 at 07 38 09" src="https://github.com/user-attachments/assets/12d483a3-3c52-4649-a00f-ee2b8e40bc8c" /> Release Notes: - Added `Ctrl+R` keybinding for opening recent projects on macOS and Linux, matching VS Code's default behavior on all platforms.
David Alecrim created
9eab76d
sidebar: Adjust "Add Local Project" button behavior (#53248)
This PR makes it so using that button from the sidebar's recent projects picker _does not_ add a new window with that project, but rather, add it to the current multi-workspace/sidebar. Previously, the `Open` action was defaulting to true even if `false` was passed to its `create_new_window` condition. Release Notes: - N/A
Danilo Leal created
810822b
Use multibuffer to fix symbol search when diff is present (#52268)
## Context
<!-- What does this PR do, and why? How is it expected to impact users?
Not just what changed, but what motivated it and why this approach.
Link to Linear issue (e.g., ENG-123) or GitHub issue (e.g., Closes #456)
if one exists — helps with traceability. -->
Fixes a bug where project symbol search navigates to the wrong position
when diff hunks are expanded. The cursor would land offset by the number
of lines added by the expanded diffs (Closes #51331). Now, users
navigating to symbols via project symbol search will land on the correct
position even when diff hunks are expanded in the editor.
The fix converts the buffer position to a `multi_buffer::Anchor` before
passing it to `select_ranges`, so it resolves correctly through the diff
transform layer instead of being interpreted as a literal MultiBuffer
coordinate.
Previously, the symbol's position was passed as a raw coordinate to the
editor, which interpreted it relative to what's displayed on screen
(including expanded diff lines). The fix converts the position to an
anchor, which is tied to the actual content in the file rather than a
screen position.
## How to Review
<!-- Help reviewers focus their attention:
- For small PRs: note what to focus on (e.g., "error handling in
foo.rs")
- For large PRs (>400 LOC): provide a guided tour — numbered list of
files/commits to read in order. (The `large-pr` label is applied
automatically.)
- See the review process guidelines for comment conventions -->
- All changes are in `crates/project_symbols/src/project_symbols.rs`.
Most of the changes are in `confirm()` method (Lines 142-154).
- There's also one change on the first line of the file.
## Self-Review Checklist
<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] 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
Release Notes:
- Fixed a bug where project symbols did not take you to the correct
location when diffs are expanded.
Steven created