Skip to content

Feature Request: sub-section matching? #681

@xav-ie

Description

@xav-ie

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 '•'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions