Wilfred / ag.el

An Emacs frontend to The Silver Searcher
http://agel.readthedocs.org/en/latest/
525 stars 61 forks source link

Solution to the issue https://github.com/Wilfred/ag.el/issues/97 #100

Closed evgeniysharapov closed 8 years ago

evgeniysharapov commented 8 years ago

The simplest solution to the problem.

Wilfred commented 8 years ago

Thanks for investigating this. I've pulled out a Windows box to play with your patch. The relevant SO question is presumably this one, for reference. I've also found a possibly relevant bug.

I suspect this is a bug in ag rather than ag.el. Do you understand why --vimgrep fixes it? It's not clear to me. I've tried ag v0.29 (the bug occurs) and v0.18.1 (no bug) via chocolatey. I couldn't find Windows builds for other versions.

I'm very happy to merge a patch for working around ag bugs, but --vimgrep implies --nocolor. As a result, this change prevents ag-highlight-results from having an effect.

Wilfred commented 8 years ago

I've added --vimgrep to the arguments passed to ag when ag-highlight-search is nil. It's not ideal, but it works as far as I can tell. Thanks so much for debugging this :)