Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: sub-section matching? #681

Open
xav-ie opened this issue Jan 16, 2025 · 2 comments
Open

Feature Request: sub-section matching? #681

xav-ie opened this issue Jan 16, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@xav-ie
Copy link

xav-ie commented Jan 16, 2025

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 '•'"
@noborus
Copy link
Owner

noborus commented Jan 17, 2025

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 noborus added the enhancement New feature or request label Jan 17, 2025
@xav-ie
Copy link
Author

xav-ie commented Jan 17, 2025

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants