This reverts commit e90aa61ca6.
The idea here was to only close the location list window if it could be
verified that it contained only syntastic data. This was done by
comparing the current location list with b:syntastic_loclist to see if
they are the same.
The problem is that, after we recheck errors, b:syntastic_loclist is
empty (if the user has fixed everything) so it doesnt match
getloclist(0) so we cant close it automatically.
Revert this for now and worry about the issue later - if a user
complains or if a new plugin that uses location lists comes up.
Conflicts:
plugin/syntastic.vim
This allows us to lazy init b:syntastic_loclist so we dont have to worry
about doing `if exists("b:syntastic_loclist")` anywhere.
Im a bit worried about doing things like
s:LocList()[0]['lnum']
since im not sure that that syntax is supported for older versions of
vim.
- changed BufLeave to BufWinLeave otherwise it would close when
jumping to loc list.
- extracted method that auto close/open location list based on
errors/settings and make sure it reopens loclist when buffer is
displayed (BufWinEnter) if needed.
Previously if we have errors displayed and we just want syntastic to
shut up, then we would use :SyntasticToggleMode but existing errors
would not be removed (ever).
So empty them out when we toggle modes.
When coming into active mode this will cause a check to be done which
will pick up errors as normal.
The gentoo vim syntax files use names like gentoo-mirrors, gentoo-metadata, etc.
This simple, and very ugly, fix makes it possible to write syntax checkers for
them.
The js syntax checker was 4 checkers stuffed into 1 file. Now it is
broken down so that each checker is in its own file inside
syntax_checkers/javascript/ while syntax_checkers/javascript.vim just
determines which file to source.
Change the names of the global js checker config variables so that
they all start with "syntastic_javascript_". This is purely for
namespacing.
Remove some unneeded logic around the config variables too. Not sure how
it got in there, but it was more confusing than helpful without offering
any benefits...
I installed the latest version of lessc and they have modified their
output slightly. Update the errorformat for this.
Also, they new output is colorized by default. So I have added an option
to specify args to the checker that currently defaults to "--no-color".
This means that if people want to use an older version of lessc, they
will need to reset this option to an empty string.
Only clear the cmd window when it is displaying a message that we
echoed. Previously we were echoing a blank line every time the cursor
moved - this was clearing messages generated from other sources than
syntastic.
In the javascript:jshint checker the error messages are being returned
with a newline prefixed to the front. I have tried to fix this in the
errorformat - but I cant see anything that would cause it.
Im not sure if this is a one-off thing, but strip out all new lines here
just in case.
Use SyntasticWarning and SyntasticError highlight groups when calling
matchadd(). This makes it trivial to clear all of our highlights without
having to store IDs.
Stole this code from kevinw's pull request (#46)
Many of the syntax checkers were setting the 'bufnr' key for each
error manually and one was setting 'text' if it didnt exist too.
Add the 'defaults' option to SyntasticMake to set default values in the
returned error list - it only sets values if they are empty.