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

update vim shortcut command to work when shortcuts file has no line n… #48

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

Conversation

DookTibs
Copy link
Contributor

@DookTibs DookTibs commented Mar 8, 2017

I often use grep/ack/ag with the "-l" switch to just list relevant files without listing exact line number matches. sack/sag displays good output with this switch, but the generated ~/.sack_shortcuts file causes problems in the create_shortcut_vim_cmd function. This change updates that function to check to see if line numbers are present in ~/.sack_shortcuts. If they are, it functions as before. If not, it launches Vim without a line number.

I didn't test this functionality with other editors, this just affects Vim users.

DookTibs added 2 commits March 8, 2017 16:59
…umbers

When running via -l to just list files that match without line numbers,
the "F *" commands didn't work properly. Update the shortcut command
to check to see if line numbers are present. If so, open starting at that
file. If not, just open the file.
"equals 2" fails if the filenames have spaces in them. change to "greaterthan/equal to 2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant