Fix stale hunks after commit (#24663)
Fixes a regression introduced in #24475. Release Notes: - N/A
This commit is contained in:
parent
bbea3a2184
commit
6e7416eb00
2 changed files with 9 additions and 14 deletions
|
@ -587,18 +587,16 @@ impl BufferDiff {
|
|||
range: Range<Anchor>,
|
||||
buffer: &text::BufferSnapshot,
|
||||
cx: &App,
|
||||
) -> Option<Range<Anchor>> {
|
||||
) -> Range<Anchor> {
|
||||
let start = self
|
||||
.hunks_intersecting_range(range.clone(), &buffer, cx)
|
||||
.next()?
|
||||
.buffer_range
|
||||
.start;
|
||||
.next()
|
||||
.map_or(Anchor::MIN, |hunk| hunk.buffer_range.start);
|
||||
let end = self
|
||||
.hunks_intersecting_range_rev(range.clone(), &buffer)
|
||||
.next()?
|
||||
.buffer_range
|
||||
.end;
|
||||
Some(start..end)
|
||||
.next()
|
||||
.map_or(Anchor::MAX, |hunk| hunk.buffer_range.end);
|
||||
start..end
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue