Skip to content
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

glitch with search results & quickfix window #69

Closed
troygoode opened this issue Nov 2, 2014 · 5 comments
Closed

glitch with search results & quickfix window #69

troygoode opened this issue Nov 2, 2014 · 5 comments

Comments

@troygoode
Copy link

Related to #57 (comment) and #58.

There is currently a bug that introduces some wonkiness with getting the search results to show within the quickfix window. Here is the issue:

  • The first time I run :Ag example the search is run (in the background), the first result is automatically opened, the quickfix window is not opened, and the status bar says No matches for "example".
  • While on a file that is also the first result of the search you're about to execute running :Ag example will now correctly open the quickfix window, but now when you load one of the results into a buffer with o the quickfix window's results are cleared away.

I am using Square's maximum-awesome plugin set (default bundles here) on OS X Yosemite with vim 7.4.52.

Here are some screenshots illustrating the above:

screenshot 2014-11-02 10 55 51
screenshot 2014-11-02 10 55 54
screenshot 2014-11-02 10 55 59
screenshot 2014-11-02 10 56 03
screenshot 2014-11-02 10 56 17

@losingkeys
Copy link
Collaborator

Can you post any g:ag* variables you've set? I'm trying to reproduce this with little luck. Thanks!

@troygoode
Copy link
Author

I don't have any g:ag* variables set manually. I do have set nomodeline due to #57 (comment)

@amarshall
Copy link

I’m seeing this issue too. I’ve managed to find what appears to be the culprit in a broad sense: using the jshint.vim plugin when the ag.vim search results include JavaScript files causes this behavior to occur. Note that this same behavior occurs with the ack.vim plugin & :Ack instead of :Ag.

Having only the jshint.vim + ag/ack.vim plugins exposes the issue, and removing only the jshint.vim plugin resolves it. I’m not sure what in there is causing it, but it’s at least a starting point.

@amarshall
Copy link

It seems to be that jshint.vim runs when entering the buffer by default, so if the first result is a JavaScript file, then ag.vim opens it, jshint.vim runs and populates the quickfix list with its errors (with are none in most cases), overriding the quickfix list that ag.vim just populated.

Set g:JSHintUpdateWriteOnly=1 to disable this behavior in jshint.vim. See also wookiehangover/jshint.vim#36.

pivotal-casebook pushed a commit to Casecommons/vim-config that referenced this issue Jan 27, 2015
See rking/ag.vim#69 (comment)

Basically this happens:

- Search with :Ag/:Ack
- Quickfix list populated with results
- First result file opened in buffer
- If that file is a JavaScript file, jshint.vim runs
- jshint.vim populates the quickfix list with its error results,
  overriding those populated by ag.vim/ack.vim.
@tomauty
Copy link

tomauty commented Jul 15, 2015

Nice find. Thanks for that. Fixed for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants