ov icon indicating copy to clipboard operation
ov copied to clipboard

Feature Request: sub-section matching?

Open xav-ie opened this issue 11 months ago • 2 comments

I think it would be fantastic if the tool could support as many sub-sections as one would desire. For example, your main section might be matched by ^commit. You want to see the overall commit as you scroll. However, you also want to see if this was ^(added:|removed:|renamed:|Δ) as you scroll, too.

You can kind of emulate the desired behavior with this command:

git show main~5..HEAD \
| delta --pager="ov --section-delimiter '^(added:|removed:|renamed:|Δ)'
                    --section-header --pattern '•' --header 3"

It keeps the commit header sticky, and you can see ^(added:|removed:|renamed:|Δ) is also sticky -- except the commit sha does not update! It just keeps the first three lines fixed (as expected, of course).

It would be awesome to have subsections that can stack separately, similar to what we can almost emulate.

I think this would also be nice to even make '•' as sub-sub section, this way you can sticky see the file that has changed, too!

How this might look in practice:

git show main~5..HEAD \
| delta --pager="ov --section-delimiter '^commit'
                    --section-sub-delimiter '^(added:|removed:|renamed:|Δ)'
                    --section-sub-sub-delimiter '•' --section-header --pattern '•'"

xav-ie avatar Jan 16 '25 12:01 xav-ie

Thank you for your feature request. I understand your request.

My concern is that the specification method is complicated, making it difficult to use. Furthermore, the implementation is also complicated.

noborus avatar Jan 17 '25 02:01 noborus

Ok, yes. I am not even sure how I would do something like this myself. It also has a lot of edge cases. Feel free to close this, please. :)

xav-ie avatar Jan 17 '25 02:01 xav-ie