altsem / gitu

A TUI Git client inspired by Magit
MIT License
1.7k stars 88 forks source link

Implement Show for HunkLine #96

Closed altsem closed 4 months ago

altsem commented 4 months ago

This could be solved by translating a line in a hunk into a line in a file:

    @@ -7,2 +7,1 @@
    -hello
    -there
->  +extra

..translates to line 7

    @@ -7,2 +7,1 @@
    -hello
->  -there
    +extra

..translates to line 8, although gitu doesn't display historical files at the moment. Just show the new file at line 8 meanwhile.

// Add this clause at src/ops/show.rs:16
// Some(TargetData::HunkLine(hunk, line)) => {
//     editor(h.new_file.as_path(), Some(*correct line goes here*))
// }
altsem commented 4 months ago

Might be too complicated for something that won't be solid anyway