Update selection when keeping/rejecting hunks (#27902)

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2025-04-02 10:38:26 +02:00 committed by GitHub
parent 57d7bc23ae
commit c1d6dfd832
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 367 additions and 114 deletions

View file

@ -163,6 +163,12 @@ impl MultiBufferDiffHunk {
self.diff_base_byte_range == (0..0)
&& self.buffer_range == (text::Anchor::MIN..text::Anchor::MAX)
}
pub fn multi_buffer_range(&self) -> Range<Anchor> {
let start = Anchor::in_buffer(self.excerpt_id, self.buffer_id, self.buffer_range.start);
let end = Anchor::in_buffer(self.excerpt_id, self.buffer_id, self.buffer_range.end);
start..end
}
}
#[derive(PartialEq, Eq, Ord, PartialOrd, Clone, Hash, Debug)]