Commit Graph

103 Commits

Author SHA1 Message Date
Martin Grenfell
2c6b271321 simpify s:ModeMapAllowsAutoChecking() 2011-12-22 00:10:13 +00:00
Martin Grenfell
d13264513d Revert "remove the ability to check compound filetypes"
This reverts commit fb0259a4ef.

Turns out there is a use case for this after all, as reported by
@benjifisher in #133

Conflicts:

	plugin/syntastic.vim
2011-12-21 23:52:58 +00:00
Martin Grenfell
a24bf027cc fix a bug with EchoCurrentError
due to an error in the logic, the echo window was being cleared after
every cursor movement instead of when moving the cursor off an error
2011-12-19 23:04:49 +00:00
kongo2002
ef7deb1127 fix bug in s:Errors() introduced with commit 755eddaa 2011-12-18 17:57:03 +01:00
Martin Grenfell
755eddaa06 make all loclist items errors by default
If a syntax checker returns items with blank 'type' keys, then make them
errors. This simplifies things since we were previously making the
assumption that empty types are errors anyway. It also fixes a bug in
EchoCurrentError() function that was due to not checking for a blank ty
pe.
2011-12-18 00:47:46 +00:00
Martin Grenfell
fb0259a4ef remove the ability to check compound filetypes
remove this for now since it is not being used and will probably never
be used
2011-12-18 00:41:44 +00:00
Martin Grenfell
7c623b7278 Revert "add Lclose() and use it when closing the loc list"
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
2011-12-17 19:16:00 +00:00
Martin Grenfell
2385a0b581 make s:FilterLocList() work on s:LocList() by default 2011-12-16 16:57:06 +00:00
Martin Grenfell
ec3ac50f76 refactor b:syntastic_loclist to s:LocList() and s:ClearLocList()
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.
2011-12-16 16:48:26 +00:00
Martin Grenfell
1e8d54d964 dont do syntax checking for any file that is non standard 2011-12-16 16:28:06 +00:00
Martin Grenfell
e90aa61ca6 add Lclose() and use it when closing the loc list
Lclose() acts as :lclose except that it checks the content of the
location list and calls :lclose if it only contains syntastic data
2011-12-16 13:36:07 +00:00
millermedeiros
d04c9766c7 BufWinLeave is always called before BufUnload, redudant. 2011-12-16 11:00:55 -02:00
millermedeiros
233f7952f1 ops, forgot to check buftype before calling lclose, avoid calling it if not needed. 2011-12-16 10:42:05 -02:00
millermedeiros
d3b122dfba fix loc list auto close. see #123
- 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.
2011-12-16 10:30:56 -02:00
millermedeiros
0d1943e6f5 auto close location list when closing or moving to another buffer. also update errors on BufEnter. see #123 2011-12-16 02:23:00 -02:00
Martin Grenfell
d053c8da1d trivial refactor 2011-12-15 23:09:17 +00:00
Martin Grenfell
bfe3725e13 make EchoCurrentError() not mask errors with warnings 2011-12-15 23:08:39 +00:00
Martin Grenfell
17f9b764de dont clobber error signs with warning signs 2011-12-15 22:52:35 +00:00
Martin Grenfell
26b45eeccf add a couple of "!"s to function defs - for consistency 2011-12-15 22:31:19 +00:00
Martin Grenfell
d85130ddf5 update errors when :SyntasticToggleMode is called
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.
2011-12-15 13:45:48 +00:00
Martin Grenfell
a210721744 change to version 2.1.0 2011-12-14 09:06:16 +00:00
Martin Grenfell
8717ff7f46 make a small refactor and add a comment 2011-12-13 23:28:39 +00:00
James Rowe
0b6587dbb6 Handle filetype names containing hyphens.
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.
2011-12-13 17:30:19 +00:00
Martin Grenfell
cafb55b3c8 fix a minor issue when echoing the current error
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.
2011-12-11 09:32:36 +00:00
Martin Grenfell
e24bd80f44 fix a strange bug when echoing error messages
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.
2011-12-11 09:26:55 +00:00
Martin Grenfell
8491df95d6 move the main autocmd into the syntastic augroup 2011-12-10 01:18:20 +00:00
Martin Grenfell
8e6ebec56e echo the current error in the cmd win
This is largely taken from kevinw's pull request (#46).

Add the g:syntastic_echo_current_error option to deactivate the
functionality.
2011-12-10 01:15:24 +00:00
Martin Grenfell
cda718643c use custom highlight groups instead of tracking match ids
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)
2011-12-10 00:18:28 +00:00
Martin Grenfell
a7f5428aaa remove -nargs=0 from the :commands since this is the default 2011-12-09 23:49:21 +00:00
Martin Grenfell
da78242123 add an option to SyntasticMake to specify defaults
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.
2011-12-09 13:47:42 +00:00
millermedeiros
90e76649f9 balloon_eval is already being checked at the top. see #114 2011-12-09 11:31:10 -02:00
millermedeiros
c95cf15823 safe-guard against signs/balloons user settings when these features aren't available. see #113 2011-12-09 10:57:28 -02:00
Martin Grenfell
7d8b7b3157 add an option to disable error highlighting 2011-12-08 22:23:51 +00:00
Martin Grenfell
bb9c87383f rearrange and comment some functions
Move 2 functions further up syntastic.vim so that all public functions
are at the bottom - purely to be tidy.

Stick some comments on functions - most functions now have at least a
one liner explaining them.

Also, rename a variable in SyntasticHighlightErrors (since I had to look
at the log to figure out what it was).
2011-12-08 20:49:24 +00:00
millermedeiros
75a5b9abfe better check for balloons as well, not throwing error but no need to call RefresBalloons if it isn't supported. 2011-12-07 11:26:19 -02:00
millermedeiros
2a88c6f219 fix error thrown while opening vim on a environment that doesn't support signs. 2011-12-07 11:16:11 -02:00
Martin Grenfell
af83357512 fix a bug with error highlighting
Store error highlight IDs on a per window basis rather than per buffer.

This is needed as matchadd() adds highlights to the current window - not
buffer. This meant an error would occur when you open a file, create an
error that caused a highlight, then open the same file in a different
window - because it would call matchdelete() with an id that wasnt
defined for the current window.
2011-12-04 00:45:07 +00:00
Martin Grenfell
975315c665 fix a bug where balloons werent being removed
Remove balloons on every refresh so they dont get left there if all
errors are fixed on the next refresh.

NO ONE LIEKS ZEE STALE BALLOONS!
2011-12-04 00:45:07 +00:00
Martin Grenfell
4ee40b271e fix a bug that was occurring with balloons
Don't try to display balloons when no errors were detected. Refactor the
ballon refresh code out into its own function.
2011-12-02 09:53:49 +00:00
Martin Grenfell
5d479552f3 fix a syntax error with the SyntasticCheck command 2011-12-02 09:36:11 +00:00
Martin Grenfell
45c77595c9 update the header comments for version 2.0.0 2011-12-02 00:27:14 +00:00
Martin Grenfell
aa67390bd6 make syntastic more active by default
Enable more of the features by default while avoiding some of the more
intrusive ones.

Update the doc to reflect this.
2011-11-30 19:56:27 +00:00
Martin Grenfell
965b3b7203 move the highlighting/balloon code into the main plugin file
In future I may move most of the code out into an autoload file, but in
the meantime I want all the code tidy and in one place for the next
release
2011-11-30 19:23:31 +00:00
Martin Grenfell
31d3a7d619 trivial cosmetic code fix 2011-11-29 08:44:51 +00:00
Martin Grenfell
5c0dbc5d05 init the components of syntastic_mode_map separately
this allows the user to skip components in their own definition
2011-11-29 08:44:09 +00:00
Martin Grenfell
295f7a5d29 shift the :command definitions to a common place - to be tidy
Previously they were with their associated functions, but better to have
them all in one place.
2011-11-29 08:38:28 +00:00
Martin Grenfell
47147aad17 remove the old code to disable/enable filetypes
This system has been superseded by the new mode map code. If requested
in future, some code may be added to manipulate the active/passive types
in the mode map at runtime to provide the same functionality.
2011-11-29 08:36:42 +00:00
Martin Grenfell
78fbd7fa13 add g:syntastic_mode_map option
This option will allow users to fine tune when automatic syntax checking
is done.

The option should be set to something like:

let g:syntastic_mode_map = { 'mode': 'active',
                           \ 'active_filetypes': [],
                           \ 'passive_filetypes': ['puppet'] }

g:syntastic_mode_map['mode'] can take one of 2 values - "active" or
"passive". When set to active, syntastic does automatic checking as
usual. When set to "passive" syntastic only checks when the user calls
:SyntasticCheck.

The exceptions to these rules are defined in "active_filetypes"
"passive_filetypes". In passive mode, automatic checks are still done
for all filetypes in the "active_filetypes" array. In active mode,
automatic checks are not done for any filetypes in the
"passive_filetypes" array.
2011-11-28 23:44:40 +00:00
Martin Grenfell
e7b8375dec Merge remote-tracking branch 'justone/add_one_time_check' 2011-11-28 23:41:53 +00:00
Martin Grenfell
3d385cf0cd fix a bug on windows 2011-11-28 23:38:45 +00:00