Make project panel to auto reveal multi buffer excerpts with latest selection#57236
Merged
Conversation
Have the editor push the cursor's buffer path to Project::set_active_path on local selection changes and on focus. This drives the existing ActiveEntryChanged consumers (project panel auto-reveal, Copilot DidFocus, edit prediction recent paths) for multibuffer items, where the workspace resolver only sees a None project_path. Singleton editors take the same path; set_active_path dedups against the workspace's own pane-event-driven calls. Release Notes: - Fixed the project panel not auto-revealing the file containing the cursor when navigating between excerpts in a multibuffer (project diff, diagnostics, project search, etc.).
Veykril
approved these changes
May 25, 2026
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 2, 2026
…election (zed-industries#57236) Make non-singleton editors to return project paths by adding a `fn active_project_path`: this had been added as `fn project_path` and similar already, so the PR replaced those methods with the generic one now. Before: https://github.com/user-attachments/assets/d0773e18-3910-4c5b-bcb3-a742f9bf9691 After: https://github.com/user-attachments/assets/e7a3f13e-9649-4564-a7e6-dccf54f8c000 Release Notes: - Made project panel to auto reveal multi buffer excerpts with latest selection
This was referenced Jun 3, 2026
5 tasks
mengh04
added a commit
to mengh04/zed
that referenced
this pull request
Jun 7, 2026
When a multi-buffer item (e.g. ProjectDiff) gains focus, the workspace calls with the cursor's project path to automatically switch the active git repository. This was safe when multi-buffer items returned from , but PR zed-industries#57236 changed ProjectDiff to return the cursor-based path (for project panel highlighting), inadvertently allowing the cursor position to override the user's explicit repository selection. Fix the issue by restoring the Singleton guard that was removed in PR zed-industries#57236: only call when the active item is backed by a single buffer. Additionally, subscribe ProjectDiff to events so that its branch_diff updates when the user switches repos via the repository selector. Fixes zed-industries#58792
mengh04
added a commit
to mengh04/zed
that referenced
this pull request
Jun 9, 2026
When a multi-buffer item (e.g. ProjectDiff) gains focus, the workspace calls with the cursor's project path to automatically switch the active git repository. This was safe when multi-buffer items returned from , but PR zed-industries#57236 changed ProjectDiff to return the cursor-based path (for project panel highlighting), inadvertently allowing the cursor position to override the user's explicit repository selection. Fix the issue by restoring the Singleton guard that was removed in PR zed-industries#57236: only call when the active item is backed by a single buffer. Additionally, subscribe ProjectDiff to events so that its branch_diff updates when the user switches repos via the repository selector. Fixes zed-industries#58792
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make non-singleton editors to return project paths by adding a
fn active_project_path: this had been added asfn project_pathand similar already, so the PR replaced those methods with the generic one now.Before:
before.mov
After:
after.mov
Release Notes: