diff --git a/asyncgit/src/sync/diff.rs b/asyncgit/src/sync/diff.rs index b2a564e0..bda8b6ea 100644 --- a/asyncgit/src/sync/diff.rs +++ b/asyncgit/src/sync/diff.rs @@ -71,7 +71,7 @@ pub struct FileDiff { /// list of hunks pub hunks: Vec, /// lines total summed up over hunks - pub lines: u16, + pub lines: usize, } pub(crate) fn get_diff_raw<'a>( @@ -144,7 +144,7 @@ pub fn get_diff( header_hash: hash(header), lines: lines.clone(), }); - res.lines += lines.len() as u16; + res.lines += lines.len(); }; let mut put = |hunk: Option, line: git2::DiffLine| { diff --git a/src/components/diff.rs b/src/components/diff.rs index 8b3d08c6..c9254f86 100644 --- a/src/components/diff.rs +++ b/src/components/diff.rs @@ -172,7 +172,7 @@ impl DiffComponent { if Self::hunk_visible(hunk_min, hunk_max, min, max) { for (i, line) in hunk.lines.iter().enumerate() { - if line_cursor >= min { + if line_cursor >= min && line_cursor <= max { Self::add_line( &mut res, width,