-
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
Highlight search only highlights results in first file opened #55
Comments
I encountered the same problem in my cli version vim,but my MacVim is good. |
@mario-grgic Thank you for your awesome solution, it solved the problem,but ,in my version I have to use the following command: call feedkeys(":let &hlsearch=1", "n") added a "" before "CR" Thank you. |
Try this please. Tell me how it performs for both of you. if exists('g:ag_highlight')
let @/ = matchstr(a:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")
call feedkeys(":let &hlsearch=1 \| echo \<CR>", 'n')
end This is how it's done in ack.vim |
|
Sorry that is a copy paste error on my behalf, ofcourse it needs to be a:args in ag.vim |
@Numkil |
I'll make a small pull request for this, I think it's a good idea to keep as much code in common with ack.vim so we can benefit from their work as well and maybe bugs will be found earlier. 👍 |
fix #55, use ack.vim's solution for highlighting the search word
I frequently switch back and forth between working_path_mode-s and I would normally do this by typing ":let" and then choosing the most recently used let command. However because of this highlighting trick the first result is always ":let &hlsearch=1 (...)" instead of what I await. |
When you have g:aghihghlight=1 in your .vimrc and perform :Ag findstring, findstring is highlighted only in first opened file. If you navigate to the next search result from the quickfix window (or with :cnext/:cprevious) findstring is no longer highlighted.
The following patch fixes this:
--- autoload/ag.vim 2014-03-27 23:30:46.000000000 -0400
+++ autoload/ag.vim.patched 2014-03-29 14:25:27.000000000 -0400
@@ -71,6 +71,7 @@
if exists("g:aghighlight")
let @/=a:args
set hlsearch
end
redraw!
The text was updated successfully, but these errors were encountered: