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

Bad interaction with Ack/Ag #42

Open
micahwedemeyer opened this issue Feb 4, 2015 · 2 comments
Open

Bad interaction with Ack/Ag #42

micahwedemeyer opened this issue Feb 4, 2015 · 2 comments

Comments

@micahwedemeyer
Copy link

I'm not sure what or why, but I was having problems with the ack.vim plugin and removing jshint.vim fixed it for me.

This describes the issue pretty well: mileszs/ack.vim#82

I know that's not a lot of info to go on, but I thought you'd like to know.

@ches
Copy link

ches commented Mar 1, 2015

ack.vim maintainer here—from a brief look at it, it seems to me that jshint.vim really bogarts the quickfix list and is going to interact poorly with pretty much anything else that wants to use it.

The main function s:JSHint() populates the quickfix list whether or not there are any errors returned from jshint, plus s:JSHint() is called a lot: on BufEnter, InsertLeave, BufWritePost, and CursorHold (which means it runs periodically when Vim is left idle, default every 4 seconds) for JavaScript buffers.

So if I'm tracing everything correctly, basically this happens:

  1. You run a search with ack.vim, which by default uses the quickfix list for results.
  2. You navigate to another JS buffer, write a JS buffer, or just do nothing for 4 seconds.
  3. jshint.vim overwrites your quickfix list, possibly with an empty list.

This is just really aggressive use of what is a "shared resource" in Vim. I don't see a very good workaround except to try to configure jshint.vim to be far more conservative, and it looks like there isn't currently any option to disable the CursorHold callbacks. I'm sorry to say this, but I'd probably either add the needed additional configuration myself, or just switch to Syntastic's support for jshint.

@mde
Copy link

mde commented Jun 20, 2015

I just installed jshint.vim, and immediately tripped over this issue. Nice plugin here, but yeah.

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

3 participants