hallettj / jslint.vim

VIM plugin and command line tool for running JSLint <http://jslint.com/>. This is project is no longer under active development. See Readme for details.
Other
463 stars 132 forks source link

JSLint Hijacks Quickfix #15

Open davertron opened 13 years ago

davertron commented 13 years ago

I'm using the 'Ack' plugin. If i do an ack search, I get the results of the search in the quickfix window. However, if I then go to one of the entries in a javascript file, jslint will replace my ack search quickfix results with any results from jslinting the file. I suspect, though I haven't confirmed, that the jslint program will replace any quickfix entries with its own after going to a js file from the quickfix list.

Can I easily change from having the jslint plugin be an ftplugin to something I can map? After a quick glance at the source, it seems like I should be able to map a key to "s:JSLint()". However, I'm not extremely familiar with vimscript.

Thanks, otherwise love the plugin and use it all the time.

NathanNeff commented 13 years ago

I'm considering the same thing. Vim has "location lists" which are quickfix windows for each window. In other words, this plugin could have a setting like "g:jslint_use_local_list". When g:jslint_use_local_list is 1, then JSLint would populate the location list instead of the quickfix window, thus preserving the contents of the quickfix window.

The location list has commands exactly like the Quickfix window, and I suspect this is the intended purpose of location list.

In the meantime, you can use :cold and :cnew to bring back the previous contents of your Quickfix window (Your Ack search results)

davertron commented 13 years ago

It sounds like the location-list approach would be the way to go then. I would still love it if I could conditionally lint though, so that it wasn't on all the time, since it seems to slow things down a bit.

NathanNeff commented 13 years ago

Sounds great to me. I don't want the jslint to hijack my quickfix list unless I would expressly say ":make" or "compile" or "check this javascript and show me the errors in quickfix".

On a side note, do you have any pointers on where to get a good javascript syntax file and indenting file?

Vim is very quirky when editing Javascript. I don't mean to hijack this thread, but you & I are the only ones on it :-)

SlexAxton commented 12 years ago

If it helps, I'll +1 using the separate window for the live linting. I run into these collisions quite a bit.

lightsblue commented 12 years ago

I use the grep.vim plugin, and it also uses the quickfix window to display grep results. http://www.vim.org/scripts/script.php?script_id=311

I think the same collision happens as discussed above between grep.vim and jslint.vim. The :cold and :cnew commands help as a workaround, but a better solution would be nice.

greg0ire commented 10 years ago

:+1: