wookiehangover / jshint.vim

JSHint fork of jslint.vim
Other
194 stars 45 forks source link

Use location list window instead of quick fix window? #18

Open acepukas opened 11 years ago

acepukas commented 11 years ago

Correct me if I'm wrong but it seems that the location list would be a more appropriate place to list errors related to a particular js file.

One example of where the quick fix window being used is problematic is if a js file is linted, and then I change the currently viewed buffer to a different js file, that new js file is linted automatically, thus changing the contents of the quick fix window (either clearing it or populating it with new data).

If the location list was used instead, the error list would stay persistent per js file.

Now if I was only working with js files (I realize that the QF window would be repopulated with each load of a js buffer) and no other plugins were using the quick fix window, this wouldn't be an "issue" anyway, but the fact that the quick fix window is being used interferes with other plugins.

eddiemonge commented 11 years ago

pr's accepted

FuDesign2008 commented 10 years ago

I think acepukas is right and I want to use location list in my plugin( https://github.com/FuDesign2008/jslhint.vim ) Is there some example about how to use location list?

acepukas commented 10 years ago

@FuDesign2008 check out my fork at https://github.com/acepukas/jshint.vim

Specifically the ftplugin/javascript/jshint.vim file. In there there are references to setloclist which is the location list equivalent to setqflist (though the function signature is different). These functions populate the location list and quick fix list respectively. Let me know if you have any questions.

mvolkmann commented 10 years ago

I would really like to see this merged. I run into an issue when I use grep to search .js file. That populates the quickfix list and opens the first matching file which for me triggers running jshint on the file. But that generates a new quickfix list which makes it difficult to traverse the remaining grep matches. So if jshint populated a location list instead, the problem would go away.

wookiehangover commented 10 years ago

@mvolkmann +1 still waiting to on @acepukas to open a PR...