-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
--column emits incorrect column number #105
Comments
Just to add a note, checking with ag 0.18.1 (which I had laying around), it also appears to use 0-based columns. |
Really? @latortuga claimed 1-based columns in #18. Looking at your vim docs link, I can't see where columns are specified to be 1-based? When I use vim, I see its line numbers and column numbers reported as both 1-based. |
Ug, it looks like I have a mismatch:
Which one is correct? |
Well, obviously,
|
--vimgrep is correct, I didn't see this option earlier. It solves my problem entirely. |
@olson-dan That's good. Meanwhile, I will re-purpose this issue to fix the off-by-1 error with --column. (How embarrassing.) Thanks! |
Trying to use ripgrep 0.2.0 with vim, I'm using "-n --color=never --column --no-header" as arguments, which lets me use a grepformat string of "%f:%l:%c:%m" to capture output and jump to the matches.
Problem is that the %c match in Vim expects a 0-based column to be output by the grep tool. The previous grep tool I was using matched this expectation. Lines are still expected to be 1-based. Documentation for vim's grepformat strings are here, for reference: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#errorformat
I've not encountered a way to do math on the column number within vim, although it may be possible. Wondering if you can support a syntax like "--column=0based", "--column=1based" or some other method to support 0-based columns.
The text was updated successfully, but these errors were encountered: