Refactored apart the forward and the backwards iterator for diff hunks

This commit is contained in:
Mikayla Maki 2023-05-19 18:09:47 -07:00
parent 43e301eeef
commit bbb68c523c
No known key found for this signature in database
9 changed files with 213 additions and 101 deletions

View file

@ -2509,18 +2509,22 @@ impl BufferSnapshot {
pub fn git_diff_hunks_in_row_range<'a>(
&'a self,
range: Range<u32>,
reversed: bool,
) -> impl 'a + Iterator<Item = git::diff::DiffHunk<u32>> {
self.git_diff.hunks_in_row_range(range, self, reversed)
self.git_diff.hunks_in_row_range(range, self)
}
pub fn git_diff_hunks_intersecting_range<'a>(
&'a self,
range: Range<Anchor>,
reversed: bool,
) -> impl 'a + Iterator<Item = git::diff::DiffHunk<u32>> {
self.git_diff
.hunks_intersecting_range(range, self, reversed)
self.git_diff.hunks_intersecting_range(range, self)
}
pub fn git_diff_hunks_intersecting_range_rev<'a>(
&'a self,
range: Range<Anchor>,
) -> impl 'a + Iterator<Item = git::diff::DiffHunk<u32>> {
self.git_diff.hunks_intersecting_range_rev(range, self)
}
pub fn diagnostics_in_range<'a, T, O>(