Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

JSLint Hijacks Quickfix #15

Open
davertron opened this issue Feb 23, 2011 · 6 comments
Open

JSLint Hijacks Quickfix #15

davertron opened this issue Feb 23, 2011 · 6 comments

Comments

@davertron
Copy link

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
Copy link

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
Copy link
Author

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
Copy link

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
Copy link

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

@lightsblue
Copy link

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
Copy link

👍

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

No branches or pull requests

5 participants