From 93bd32b425a45942547e538ce2b8bd5c56fca10a Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Fri, 21 Mar 2025 11:21:05 -0400 Subject: [PATCH] Fix toggling breakpoints not working when text anchor isn't at start (#27249) This fixes a bug where breakpoint's were unable to be toggled if the text::Anchor representing the breakpoint position was not at the beginning of a line. Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/editor/src/editor.rs | 4 +++- crates/workspace/src/persistence.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index c4fe9d8c0b..bd54b3e418 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -6019,7 +6019,9 @@ impl Editor { .breakpoints(&buffer, None, buffer_snapshot.clone(), cx) { let point = buffer_snapshot.summary_for_anchor::(&breakpoint.0); - let anchor = multi_buffer_snapshot.anchor_before(point); + let mut anchor = multi_buffer_snapshot.anchor_before(point); + anchor.text_anchor = breakpoint.0; + breakpoint_display_points.insert( snapshot .point_to_display_point( diff --git a/crates/workspace/src/persistence.rs b/crates/workspace/src/persistence.rs index 78178ce216..45681d75b6 100644 --- a/crates/workspace/src/persistence.rs +++ b/crates/workspace/src/persistence.rs @@ -699,7 +699,7 @@ impl WorkspaceDb { match breakpoints { Ok(bp) => { if bp.is_empty() { - log::error!("Breakpoints are empty after querying database for them"); + log::debug!("Breakpoints are empty after querying database for them"); } let mut map: BTreeMap, Vec> = Default::default();