From 7c3dc1e3dca12bd7c1729524f76754bf9d2e75cc Mon Sep 17 00:00:00 2001 From: Julia Date: Mon, 12 Dec 2022 11:57:14 -0500 Subject: [PATCH] Cleanup --- crates/editor/src/multi_buffer.rs | 34 ------------------------------- crates/git/src/diff.rs | 3 --- 2 files changed, 37 deletions(-) diff --git a/crates/editor/src/multi_buffer.rs b/crates/editor/src/multi_buffer.rs index 736db68965..a386403a41 100644 --- a/crates/editor/src/multi_buffer.rs +++ b/crates/editor/src/multi_buffer.rs @@ -2635,7 +2635,6 @@ impl MultiBufferSnapshot { row_range: Range, reversed: bool, ) -> impl 'a + Iterator> { - // dbg!(&row_range); let mut lines_advance = 0; let mut cursor = self.excerpts.filter::<_, ExcerptSummary>(move |summary| { let filter = summary.text.lines.row + lines_advance >= row_range.start @@ -2652,8 +2651,6 @@ impl MultiBufferSnapshot { let range = excerpt.range.context.clone(); let range_start_row = range.start.to_point(&excerpt.buffer).row; - let range_end_row = range.end.to_point(&excerpt.buffer).row; - // dbg!(range_start_row); let a = Some(excerpt.buffer.git_diff_hunks_in_range(range, reversed).map( move |mut hunk| { hunk.buffer_range.start = hunk.buffer_range.start.max(range_start_row) @@ -2669,37 +2666,6 @@ impl MultiBufferSnapshot { a }) .flatten() - // let mut cursor = self.excerpts.cursor::(); - // cursor.seek(&Point::new(row_range.start, 0), Bias::Left, &()); - - // let mut is_first = true; - // let mut advance = 0; - // std::iter::from_fn(move || { - // if !is_first { - // cursor.next(&()); - // } - // is_first = false; - - // let (item, summary) = match (cursor.item(), cursor.item_summary()) { - // (Some(item), Some(summary)) => (item, summary), - // _ => return None, - // }; - - // // dbg!(&advance); - // // if advance > row_range.end { - // // println!("returning none"); - // // return None; - // // } - - // // let row_range = row_range.start - advance..row_range.end - advance; - // // println!("returning an iterator, {row_range:?}"); - // // // summary. - // // advance += summary.text.lines.row; - // Some(item.buffer.git_diff_hunks_in_range(row_range, reversed)) - - // item.range - // }) - // .flatten() } pub fn range_for_syntax_ancestor(&self, range: Range) -> Option> { diff --git a/crates/git/src/diff.rs b/crates/git/src/diff.rs index 3a818e6505..61396e9278 100644 --- a/crates/git/src/diff.rs +++ b/crates/git/src/diff.rs @@ -77,9 +77,6 @@ impl BufferDiff { buffer: &'a BufferSnapshot, reversed: bool, ) -> impl 'a + Iterator> { - // let start = buffer.anchor_before(Point::new(query_row_range.start, 0)); - // let end = buffer.anchor_after(Point::new(query_row_range.end, 0)); - let mut cursor = self.tree.filter::<_, DiffHunkSummary>(move |summary| { let before_start = summary.buffer_range.end.cmp(&range.start, buffer).is_lt(); let after_end = summary.buffer_range.start.cmp(&range.end, buffer).is_gt();