GitSavvy icon indicating copy to clipboard operation
GitSavvy copied to clipboard

Inline diff: Fold code outside hunks

Open tomngo opened this issue 8 years ago • 4 comments

I'm loving GitSavvy inline diff for most things, but one feature in particular keeps sending me back to SourceTree: the ability to see all changes quickly with minimal space dedicated to the intervening unchanged code. To that end, could we make it possible to fold code outside of the hunks?

I'd ask for a quick way to change the hunk size. – perhaps the number keys could serve this purpose (1 = 1 line of context, 2 = 3 lines of context, 3 = 6 lines of context, 0 = no folding).

tomngo avatar Jul 29 '16 15:07 tomngo

One way we could go about this with minimal impact to our codebase is to use the actual code folding feature itself. That should be a relatively simple change, and making context configurable wouldn't be any harder, I think. We can definitely give it a try!

divmain avatar Jul 29 '16 23:07 divmain

Should we add these command for the normal diff so you can control the contex code?

stoivo avatar Jul 30 '16 06:07 stoivo

That would be useful too – and more consistent. The only difference, I think, would be that the normal diff would have no analogue for the "no folding" command.

tomngo avatar Jul 30 '16 14:07 tomngo

Adding an element to my original suggestion: originally, I thought of varying the hunk size only as a way to control the folding behavior. This may have been obvious to others, but I just realized that varying the hunk size should also control what happens when you press h to stage a hunk.

tomngo avatar Aug 04 '16 16:08 tomngo