Wilfred / ag.el

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

Highlight match in ag-search Buffer on Windows #116

Closed evgeniysharapov closed 7 years ago

evgeniysharapov commented 8 years ago

When we use --vimgrep ag doesn't output escape sequences. This PR allows to highlight matches in ag-search buffer when --vimgrep option is used. Using --vimgrep is necessary on Windows, so without this change Windows users will not have highlighting of the matches.

Wilfred commented 8 years ago

Thanks for investigating this. However, previously --vimgrep was automatically selected for windows users, so ag.el worked out-of-the-box for windows users. We now require windows users to set ag-vimgrep, is that correct? Why do we need to do this?

evgeniysharapov commented 8 years ago

Value of a variable ag-vimgrep is set automatically based on the operating system. So for users's there's no difference, but now one has option to change whether he wants to have --vimgrep or not in the command line for ag. The rest of the pull request is dealing with using highlighting - whether to rely on the ESC sequences or use regular expression in a *ag* buffer.

Wilfred commented 7 years ago

I'm sorry, but I don't think this should be a user-exposed configuration option. We should always support highlighting if we can. v1.0 will support highlighting of literals on all platforms, and provide fallback highlighting for regexps on platforms where we don't have shell escape sequences.

Sorry this has taken so long to respond.