Skip to content

Feature Request: Match section-delimeter across lines #682

@xav-ie

Description

@xav-ie

git show main~5...main has output like this:

commit 7fb7b37321cf626fd24807c896928e0761c58413 (HEAD -> main)
Author: xav-ie <github@xav.ie>
Date:   Wed Jan 15 12:53:23 2025 -0500

    feat(g): add

    A better git status.


Δ home-manager/programs/nushell/default.nix

My current section delimeters are like this:

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

This works mostly, but I want the second group: (^commit) to span to include Author: and Date: lines in its section match. So far, none of these work...:

# this one works, but does not match the second line
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*)'"
# the rest of these do not match at all
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*\r)'"
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*\n)'"
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*\\r)'"
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*\\n)'"
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*\\\r)'"
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*\\\n)'"
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*\\\\r)'"
git show main~5..main | delta --pager="ov --section-delimiter '(^(added:|removed:|renamed:|Δ))|(^commit.*\\\\n)'"

I don't want to use the number modifiers. Those modifiers apply it to all sections. I just want to match a multiline section-delimeter.

I do notice that the README says:

(Line breaks are not included in matching lines).

But I want this. Maybe the scrolling math for changing section-delimeter height does not work so well

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