-
Notifications
You must be signed in to change notification settings - Fork 131
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
:AgBuffer fix for legacy --column users #89
Conversation
Prior to the `--vimgrep` option being added, it was very hard to get Ag to output file names consistently if only one file was searched rather than multiple files or a directory [1]. This meant that if you ran an `:AgBuffer` search when you had only opened one buffer in your Vim session, quickfix navigation would be broken for your results. The changed incantation of `ag` in this commit is the best behavior I was able to get out of earlier Ag versions, after a long saga. It has one minor drawback: it results in empty newlines between results for different files, where a heading might otherwise be. This is a small cosmetic problem--Vim's quickfix parses it just fine and skips over these on `:cnext` without any glitch or extra keystrokes. This seems a worthwhile exchange for the outright bug of the single-buffer case. References d42171e [1]: ggreer/the_silver_searcher#361
The new Thanks again for your work on this, especially the doc update. |
Yeah, on current ag versions, the The main point of this change is fixing the fact that As for the specifics of the arguments, I'd have to confirm for certain after installing an older ag since I've now upgraded, but as you can tell from the issue I linked, I spent a lot of time trying combinations before |
Ohh, I was testing it wrong (changing some logic in the plugin instead of changing I guess I'm still confused as to why |
Sorry if I sound impatient, but what I've tried to make clear is that ag's handling of its options is at times nonintuitive and at others downright zany. It's changed at times from version to version but there are still a lot of cases where it doesn't make sense and possibly contradicts documentation. You can take my word for it that this set of options, however senseless it may seem, was the best result I could get before But if you happen to get a report from any user of an older |
Just double checking some of your research 😄. Thanks again for the pull! |
:AgBuffer fix for legacy --column users
Prior to the
--vimgrep
option being added, it was very hard to get Ag to output file names consistently if only one file was searched rather than multiple files or a directory.TL;DR on that, it meant that if you ran an
:AgBuffer
search when you had only opened one buffer in your Vim session, quickfix navigation would be broken for the results (no file names in the output).The changed incantation of
ag
in this commit is the best behavior I was able to get out of earlier Ag versions, after a long saga. It has one minor drawback: it results in empty newlines between results for different files, where a heading might otherwise be. This is a small cosmetic problem that probably isn't worth special-case code to parse out—Vim's quickfix parses it just fine and skips over these blank lines on:cnext
without any glitch or extra keystrokes. This seems a worthwhile exchange for the outright bug of the single-buffer case.References d42171e