Merge remote-tracking branch 'nik-rev/gix-blame'

This commit is contained in:
Kalle Carlbark 2025-04-02 21:04:54 +02:00
commit 8229e746ae
2 changed files with 8 additions and 1 deletions
helix-vcs/src
helix-view/src

View file

@ -75,6 +75,13 @@ impl DiffHandle {
}
}
pub fn try_load(&self) -> Option<Diff> {
Some(Diff {
diff: self.diff.try_read()?,
inverted: self.inverted,
})
}
/// Updates the document associated with this redraw handle
/// This function is only intended to be called from within the rendering loop
/// if called from elsewhere it may fail to acquire the render lock and panic

View file

@ -1602,7 +1602,7 @@ impl Document {
// file in the file system into what gix::blame knows about (gix::blame only
// knows about commit history, it does not know about uncommitted changes)
diff_handle
.load()
.try_load()?
.hunks_intersecting_line_ranges(std::iter::once((0, cursor_line as usize)))
.try_fold(
(0, 0),