Fix toggling deletion hunk with mouse at start of buffer (#25726)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-02-27 12:08:20 -05:00 committed by GitHub
parent e8ef36edcc
commit 4e60ebab5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 73 additions and 1 deletions

View file

@ -2417,7 +2417,7 @@ impl MultiBuffer {
let snapshot = self.read(cx);
let mut cursor = snapshot.diff_transforms.cursor::<usize>(&());
let offset_range = range.to_offset(&snapshot);
cursor.seek(&offset_range.start, Bias::Right, &());
cursor.seek(&offset_range.start, Bias::Left, &());
while let Some(item) = cursor.item() {
if *cursor.start() >= offset_range.end && *cursor.start() > offset_range.start {
break;