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: also print the line number #27

Open
whatisaphone opened this issue Dec 1, 2023 · 6 comments
Open

Feature request: also print the line number #27

whatisaphone opened this issue Dec 1, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@whatisaphone
Copy link

It would be handy if cs had an option to print the line number, so you could write a script that opens your editor to the right place without having to scroll.

A good format might be file:line e.g. path/to/file.txt:42

@boyter
Copy link
Owner

boyter commented Dec 3, 2023

This is possibly already supposed through the use of the vimgrep output flag,

$ cs -f vimgrep test
implemtations/go/cmd/peer/stop.sh:5:34: peers..."\npkill -9 peertester | true
implemtations/go/cmd/peer/README.md:1:0:Run the main peer if required to test things.\n\nThen run `./start.sh`
implemtations/go/cmd/peer/start.sh:2:12:\nset -e\ngo build -o peertester\n\nSTART=8000\nTOTAL_IT

Is that what you were expecting? Or more along the lines of the whole lines for a regular snippet?

@boyter boyter added the enhancement New feature or request label Dec 3, 2023
@whatisaphone
Copy link
Author

whatisaphone commented Dec 4, 2023

It looks like -f only has an effect if you pass a query on the command line, not if you run cs without args and type the query interactively. I was hoping to use the interactive picker, hit enter, then be able to parse the output and open an editor straight to the context line I picked in the UI.

@boyter
Copy link
Owner

boyter commented Dec 4, 2023

Ah gotcha. Yes this can be done. Im looking at getting issue23 resolved first, and then can look into this.

@BourgeoisBear
Copy link

Would you accept an outside pull request for this?

@boyter
Copy link
Owner

boyter commented Apr 1, 2024

Always happy to accept PR's!

@BourgeoisBear
Copy link

Give me a few days to get to it, and I'll take care of it.

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

3 participants