Skip to content

debugger: Open correct pane for breakpoints#49390

Merged
Anthony-Eid merged 5 commits intomainfrom
debugger-bp-opens-correct-pane
Feb 24, 2026
Merged

debugger: Open correct pane for breakpoints#49390
Anthony-Eid merged 5 commits intomainfrom
debugger-bp-opens-correct-pane

Conversation

@Anthony-Eid
Copy link
Contributor

@Anthony-Eid Anthony-Eid commented Feb 17, 2026

Closes #40602

Summary

This PR ensures that active debug lines only open in a single pane and new active debug lines are added to the most recent pane that contained an active debug line. This fixes a bug where Zed could go to the active debug line file and location in every pane a user had open, even if that pane was focused on a different file.

I fixed this by storing the entity_id of the pane containing the most recently active debug line on BreakpointStore, this is consistent with where the selected stack frame is stored. I used an entity_id instead of a strong type to avoid circular dependencies. Whenever an active debug line is being set in the editor or by the debugger it now checks if there's a specific pane it should be set in, and after setting the line it updates BreakpointStore state.

I also added a new method on the workspace::Item trait called fn pane_changed(&mut self, new_pane_id: EntityId, cx: &mut Context<Self>) To enable Editor to update BreakpointStore's active debug line pane id whenever an Editor is moved to a new pane.

PR review TODO list

Before you mark this PR as ready for review, make sure that you have:

  • Added a solid test coverage and/or screenshots from doing manual testing
  • Done a self-review taking into account security and performance aspects
  • Aligned any UI changes with the UI checklist

Release Notes:

  • debugger: Fix bug where active debug lines could be set in the wrong pane

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 17, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Feb 17, 2026
@maxdeviant maxdeviant changed the title debugger: bp opens correct pane debugger: Open correct pane for breakpoints Feb 17, 2026
@Anthony-Eid Anthony-Eid merged commit c6a82b3 into main Feb 24, 2026
28 checks passed
@Anthony-Eid Anthony-Eid deleted the debugger-bp-opens-correct-pane branch February 24, 2026 11:49
github-actions bot added a commit that referenced this pull request Feb 24, 2026
debugger: Open correct pane for breakpoints

Auto-generated documentation suggestions for review at next preview release.
Anthony-Eid added a commit to bobbymannino/zed that referenced this pull request Feb 25, 2026
Closes zed-industries#40602

### Summary

This PR ensures that active debug lines only open in a single pane and
new active debug lines are added to the most recent pane that contained
an active debug line. This fixes a bug where Zed could go to the active
debug line file and location in every pane a user had open, even if that
pane was focused on a different file.

I fixed this by storing the `entity_id` of the pane containing the most
recently active debug line on `BreakpointStore`, this is consistent with
where the selected stack frame is stored. I used an `entity_id` instead
of a strong type to avoid circular dependencies. Whenever an active
debug line is being set in the editor or by the debugger it now checks
if there's a specific pane it should be set in, and after setting the
line it updates `BreakpointStore` state.

I also added a new method on the `workspace::Item` trait called `fn
pane_changed(&mut self, new_pane_id: EntityId, cx: &mut Context<Self>)`
To enable `Editor` to update `BreakpointStore`'s active debug line pane
id whenever an `Editor` is moved to a new pane.


### PR review TODO list

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- debugger: Fix bug where active debug lines could be set in the wrong
pane
morgankrey added a commit that referenced this pull request Feb 25, 2026
Auto-applied queued documentation suggestions from:
- PR #48908
- PR #48909
- PR #48910
- PR #48912
- PR #48930
- PR #44794
- PR #48763
- PR #45073
- PR #48495
- PR #49374
- PR #49139
- PR #48780
- PR #48619
- PR #48978
- PR #48962
- PR #48988
- PR #47860
- PR #49015
- PR #47095
- PR #47475
- PR #48542
- PR #46766
- PR #47754
- PR #48807
- PR #44506
- PR #49051
- PR #49069
- PR #48842
- PR #48851
- PR #48736
- PR #47673
- PR #49094
- PR #49098
- PR #49622
- PR #49554
- PR #49710
- PR #49716
- PR #49732
- PR #49788
- PR #49876
- PR #49902
- PR #49910
- PR #49390
- PR #50027

Generated with script/docs-suggest-publish for human review in draft PR.
morgankrey added a commit that referenced this pull request Feb 25, 2026
Auto-applied queued documentation suggestions from:
- PR #48908
- PR #48909
- PR #48910
- PR #48912
- PR #48930
- PR #44794
- PR #48763
- PR #45073
- PR #48495
- PR #49374
- PR #49139
- PR #48780
- PR #48619
- PR #48978
- PR #48962
- PR #48988
- PR #47860
- PR #49015
- PR #47095
- PR #47475
- PR #48542
- PR #46766
- PR #47754
- PR #48807
- PR #44506
- PR #49051
- PR #49069
- PR #48842
- PR #48851
- PR #48736
- PR #47673
- PR #49094
- PR #49098
- PR #49622
- PR #49554
- PR #49710
- PR #49716
- PR #49732
- PR #49788
- PR #49876
- PR #49902
- PR #49910
- PR #49390
- PR #50027

Generated with script/docs-suggest-publish for human review in draft PR.
tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
Closes zed-industries#40602

### Summary

This PR ensures that active debug lines only open in a single pane and
new active debug lines are added to the most recent pane that contained
an active debug line. This fixes a bug where Zed could go to the active
debug line file and location in every pane a user had open, even if that
pane was focused on a different file.

I fixed this by storing the `entity_id` of the pane containing the most
recently active debug line on `BreakpointStore`, this is consistent with
where the selected stack frame is stored. I used an `entity_id` instead
of a strong type to avoid circular dependencies. Whenever an active
debug line is being set in the editor or by the debugger it now checks
if there's a specific pane it should be set in, and after setting the
line it updates `BreakpointStore` state.

I also added a new method on the `workspace::Item` trait called `fn
pane_changed(&mut self, new_pane_id: EntityId, cx: &mut Context<Self>)`
To enable `Editor` to update `BreakpointStore`'s active debug line pane
id whenever an `Editor` is moved to a new pane.


### PR review TODO list

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- debugger: Fix bug where active debug lines could be set in the wrong
pane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Debugger: Jump to breakpoint only in the proper split view

1 participant