From e8daab15ab06a04aee8e2137ebf4da1e5127901e Mon Sep 17 00:00:00 2001 From: Remco Smits Date: Wed, 12 Nov 2025 19:18:10 +0100 Subject: [PATCH] debugger: Fix prevent creating breakpoints inside breakpoint editor (#42475) Closes #38057 This PR fixes that you can no longer create breakpoints inside the breakpoint editor in code called `BreakpointPromptEditor`. As you can see, inside the after video, there is no breakpoint editor created anymore. **Before** https://github.com/user-attachments/assets/c4e02684-ac40-4176-bd19-f8f08e831dde **After** https://github.com/user-attachments/assets/f5b1176f-9545-4629-be12-05c64697a3de Release Notes: - Debugger: Prevent breakpoints from being created inside the breakpoint editor --- crates/editor/src/editor.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index d4647300996ecfb14dbc470ef8d9cc8a5db3d1dd..cff337714b9619b54469e8915bfb36ff7a69111e 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -11060,6 +11060,10 @@ impl Editor { window: &mut Window, cx: &mut Context, ) { + if self.breakpoint_store.is_none() { + return; + } + for (anchor, breakpoint) in self.breakpoints_at_cursors(window, cx) { let breakpoint = breakpoint.unwrap_or_else(|| Breakpoint { message: None, @@ -11119,6 +11123,10 @@ impl Editor { window: &mut Window, cx: &mut Context, ) { + if self.breakpoint_store.is_none() { + return; + } + for (anchor, breakpoint) in self.breakpoints_at_cursors(window, cx) { let Some(breakpoint) = breakpoint.filter(|breakpoint| breakpoint.is_disabled()) else { continue; @@ -11138,6 +11146,10 @@ impl Editor { window: &mut Window, cx: &mut Context, ) { + if self.breakpoint_store.is_none() { + return; + } + for (anchor, breakpoint) in self.breakpoints_at_cursors(window, cx) { let Some(breakpoint) = breakpoint.filter(|breakpoint| breakpoint.is_enabled()) else { continue; @@ -11157,6 +11169,10 @@ impl Editor { window: &mut Window, cx: &mut Context, ) { + if self.breakpoint_store.is_none() { + return; + } + for (anchor, breakpoint) in self.breakpoints_at_cursors(window, cx) { if let Some(breakpoint) = breakpoint { self.edit_breakpoint_at_anchor(