Skip to content

Make project panel to auto reveal multi buffer excerpts with latest selection#57236

Merged
Veykril merged 1 commit into
mainfrom
kb/multi-buffer-auto-reveal
May 25, 2026
Merged

Make project panel to auto reveal multi buffer excerpts with latest selection#57236
Veykril merged 1 commit into
mainfrom
kb/multi-buffer-auto-reveal

Conversation

@SomeoneToIgnore

Copy link
Copy Markdown
Contributor

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:

before.mov

After:

after.mov

Release Notes:

  • Made project panel to auto reveal multi buffer excerpts with latest selection

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.).
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 20, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label May 20, 2026
@SomeoneToIgnore SomeoneToIgnore added the area:editor Feedback for code editing, formatting, editor iterations, etc label May 20, 2026
@SomeoneToIgnore SomeoneToIgnore requested a review from Veykril May 25, 2026 07:51
@Veykril Veykril added this pull request to the merge queue May 25, 2026
Merged via the queue into main with commit d3a9fd9 May 25, 2026
55 checks passed
@Veykril Veykril deleted the kb/multi-buffer-auto-reveal branch May 25, 2026 11:55
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editor Feedback for code editing, formatting, editor iterations, etc cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants