Don't clobber global grepprg, or quickfix mappings #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
'grepprg'is a buffer-local setting. We should only use the&lversion, or else when we restore it after an:Agcommand, we're disrupting the setting in other buffers.It's surprising that
'grepprg'is local and global, and'grepformat'is only global, so I guess we have no choice but to clobber it. Perhaps this has it's uses: suppose you have a C program with some tests in shell (or cram, etc., like ag!), and you always useagfor'grepprg'. The same'grepformat'can work project-wide, but you might have an autocommand that makes'grepprg'useag --shellfor all files under the tests directory.Anyway, it's kind of pathological, but we just shouldn't clobber a global setting when local can be used. I was working on something else when I made the small changes here, but that's going to warrant deeper review discussion when it's ready I think, so I went ahead and isolated these changes.
Update: I realized the
<buffer>mappings were broken too,<buffer>must be given first or it doesn't work. Fix included.