Debugger: Switch Breakpoint Anchor from left to right (#27688)

This fixes an edge case where some breakpoints would not render
correctly when expanding a conflict git hunk.

## Before 


https://github.com/user-attachments/assets/4fd75ef6-8381-4f9e-9765-5eeb3a734df0

## After


https://github.com/user-attachments/assets/b2b49894-2dc2-42ba-8038-504a1b4c2665


Release Notes:

- N/A

Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Anthony Eid 2025-03-28 16:04:44 -04:00 committed by GitHub
parent 28f0ba3381
commit 55c1f9d26c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 93 additions and 93 deletions

View file

@ -8620,7 +8620,7 @@ impl Editor {
.snapshot(window, cx)
.display_snapshot
.buffer_snapshot
.anchor_before(Point::new(cursor_position.row, 0));
.anchor_after(Point::new(cursor_position.row, 0));
(
breakpoint_position,
@ -8687,7 +8687,7 @@ impl Editor {
.snapshot(window, cx)
.display_snapshot
.buffer_snapshot
.anchor_before(Point::new(cursor_position.row, 0));
.anchor_after(Point::new(cursor_position.row, 0));
self.edit_breakpoint_at_anchor(
breakpoint_position,

View file

@ -6858,7 +6858,7 @@ impl Element for EditorElement {
.or_insert_with(|| {
let position = snapshot.display_point_to_anchor(
gutter_breakpoint_point,
Bias::Left,
Bias::Right,
);
let breakpoint = Breakpoint::new_standard();

View file

@ -17,7 +17,7 @@ use std::{
path::Path,
sync::Arc,
};
use text::PointUtf16;
use text::{Point, PointUtf16};
use crate::{buffer_store::BufferStore, worktree_store::WorktreeStore, Project, ProjectPath};
@ -503,7 +503,7 @@ impl BreakpointStore {
this.update(cx, |_, cx| BreakpointsInFile::new(buffer, cx))?;
for bp in bps {
let position = snapshot.anchor_before(PointUtf16::new(bp.position, 0));
let position = snapshot.anchor_after(Point::new(bp.position, 0));
breakpoints_for_file.breakpoints.push((
position,
Breakpoint {