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

Trim trailing colons from paths to allow copy/pasting git grep -n output #9963

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chschneider
Copy link

This is a minimalistic change to allow output from git grep -n including line numbers and a trailing colon to be copy-pasted for editing without having to remove the trailing colon, e.g.

$ git grep -n trim_end_matches
helix-term/src/args.rs:132:    let mut s = s.trim_end_matches(':').rsplitn(3, ':');
helix-term/src/args.rs:144:    let (path, row) = s.trim_end_matches(':').rsplit_once(':')?;
$ hx helix-term/src/args.rs:132:

The same change was made for git grep -n --column, i.e. the path:line:col: format.

@the-mikedavis the-mikedavis added the S-waiting-on-review Status: Awaiting review from a maintainer. label Mar 22, 2024
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants