Commit Graph

842 Commits

Author SHA1 Message Date
LCD 47
e6bb7bd4c6 Bug fix: :SyntasticInfo didn't return information for composite filetypes. 2013-05-31 19:06:33 +03:00
LCD 47
1e8cc9e506 Added some registry defaults. 2013-05-31 14:37:51 +03:00
LCD 47
48b934b8aa Adds filetype aliases.
This allows checking of files with non-standard filetypes.
2013-05-31 10:19:52 +03:00
LCD 47
bad592ece8 Minor fixes. 2013-05-30 19:08:12 +03:00
LCD 47
d205c97e95 Clear loclist if there are no errors. Fixes #650. 2013-05-27 09:23:09 +03:00
LCD 47
4d9a8338e1 Minor optimisation related to syntastic_ignore_files. 2013-05-23 11:50:26 +03:00
Martin Grenfell
86fdb12540 Merge remote-tracking branch 'origin/modemap_ignore' 2013-05-17 15:58:07 +01:00
LCD 47
7b5b259d89 More fixes backported from the buffers branch. 2013-05-15 09:04:34 +03:00
LCD 47
8a998efe54 Backport of small fixes from the buffers branch. 2013-05-14 20:21:57 +03:00
LCD 47
8d47df65d2 Adds an option g:syntastic_ignore_files.
List of regexps specifying files that should neither be checked, nor
included in error lists.  The full paths of files are matched against
these regexps, and the matches are case sensitive.
2013-05-14 11:14:49 +03:00
LCD 47
7319cb6a9e Postprocessing functions.
This patch adds an option 'postprocess' to SyntasticMake().  The value
of this option is a list of names.  Each name is translated to a
function syntastic#postprocess#name().  These functions are applied in
order to the list of errors just before SyntasticMake() returns.  They
take a single parameter, the list of errors, and are supposed to
returned the processed list.
2013-05-10 14:11:07 +03:00
LCD 47
7f0412e91d Added an option to skip checks on :wq, :x, and :ZZ, try 2. 2013-05-06 20:18:02 +03:00
LCD 47
431508e19e Fix for #641: back off 003751a. 2013-05-06 19:26:45 +03:00
LCD 47
003751a48d Be less wastefull about loclists.
This is a first step towards making :lolder and :lnewer work with
Syntastic.  It still has a long way to go: a new loclist is now craeted
at each run of SyntasticMake(), but the notification machinery can only
use the last one.  Ideally a single loclist would be created per window
and then reused.
2013-05-04 09:36:52 +03:00
LCD 47
f7508703d6 Call notifiers.reset() only for enabled notifiers. 2013-05-03 09:24:34 +03:00
LCD 47
4d694ad920 The QuitPre event was added in Vim 7.3.544. 2013-04-27 18:06:18 +03:00
LCD 47
c9b9a9ef5e Fix for #624.
Handle closing the loclist window in a QuitPre.
Remove the prematurely added option g:syntastic_allow_quit.
2013-04-27 13:59:19 +03:00
LCD 47
63ec78cfb1 Adds an option "syntastic_allow_quit". 2013-04-26 16:20:43 +03:00
Martin Grenfell
b72d9e57da add :SyntasticInfo command to echo info about current checkers
Closes #557
2013-04-13 23:36:18 +01:00
Martin Grenfell
49b6012f98 add basic deprecation warning system 2013-04-13 17:19:24 +01:00
Martin Grenfell
a9938e0afd Merge remote-tracking branch 'origin/notifiers'
Conflicts:
	autoload/syntastic/util.vim
2013-04-13 17:05:18 +01:00
Martin Grenfell
fbbb30295b add a simple debug message system
We may want to add debug messages at many points. We can add them as we
find we need them - i.e. when debugging stuff with users.
2013-04-13 16:51:23 +01:00
Martin Grenfell
a7fcf4cad2 Merge branch 'notifiers' 2013-04-13 16:11:14 +01:00
Martin Grenfell
e3f5958b7d bump to version 3.0.0 2013-04-13 16:02:03 +01:00
LCD 47
3083df59fc Addresses #530.
If variable g:syntastic_[filetype]_checker is found in user's config,
g:syntastic_[filetype]_checkers is set and a warning is issued.
2013-04-13 11:04:47 +03:00
LCD 47
4e32123b53 Make the enabled() method optional. 2013-04-11 23:49:39 +03:00
LCD 47
0248a848d3 Minor bug fix. 2013-04-10 13:48:19 +03:00
LCD 47
fac0d46c85 Rename signer.vim -> signs.vim. 2013-04-10 13:45:18 +03:00
LCD 47
11380c2d51 Minor cleanup.
Warning signs should not overwrite error ones.
Use buffers instead of file names when placing signs.
Other minor changes.
2013-04-10 13:40:03 +03:00
LCD 47
31b654301b Fix for #597.
If the first error in the location list refers to a file that isn't
loaded, entering the quickfix window would close it.

If `hidden` is set, `:quit`-ing the main file would not close the
quickfix window.
2013-04-09 18:20:14 +03:00
Martin Grenfell
2b6f6a5724 move s:Loclist() into SyntasticLoclist as a class method 2013-04-09 09:52:02 +01:00
LCD 47
92a25ed1a2 More cleaning up.
Renames notification classes.
Fixes a stupid bug related to the cursor notifier.
2013-04-09 01:10:17 +03:00
LCD 47
90dce6d3e7 Cleanup.
Makes cursor a standard notifier.
Adds a method enabled() to the notifiers.
Adds an optional method reset() to the notifiers.
2013-04-09 00:24:54 +03:00
Martin Grenfell
9a7db4a50b move a couple of options out into relevant notifiers 2013-04-07 23:30:24 +01:00
Martin Grenfell
dc3d80a204 more refactors to the Notifier classes
Move the autoloc list toggling out into its own notifier class.

Move the function that echos the error on the current line out into its
own notifier.

A few other changes were required in the process:
* move s:WideMsg() out into syntastic#util autoload lib so it is
  available from the cursor notifier.
* move s:ShowLocList() into the LocList class so it is available for
  the autoloclist notifier
* move s:HideLocList() into Loclist as a class method mainly to keep the
  two show/hide methods together
* move the s:old_line var into the Cursor notifier where it is needed
2013-04-07 23:06:02 +01:00
LCD 47
0deeefd08e Notifiers refactor.
Creates a notifier class.
Changes the existing signer class to fit the new notifier.
Moves balloons and highlighting to their own classes.
Caches and speeds up EchoCurrentError().
Adds all relevant messages to balloons rather than using the first one.
Fixes yet another (minor) bug related to g:syntastic_quiet_warnings.
2013-04-07 22:10:26 +03:00
LCD 47
01232979aa Fix signs initialization.
Signs should be initialized even if they aren't enabled at startup.
2013-04-06 23:10:27 +03:00
LCD 47
ba13a3d4b5 Fix shell pipe hack. 2013-04-06 21:58:38 +03:00
LCD 47
e473038e66 Fixes handling of g:syntastic_quiet_warnings.
Fixes signs (leftover from commit 878bcea).
2013-04-06 21:19:30 +03:00
LCD 47
878bceaac7 Fixes handling of g:syntastic_quiet_warnings. 2013-04-03 21:53:56 +03:00
LCD 47
bd226bb026 Minor cleanup. 2013-04-03 11:45:06 +03:00
LCD 47
1f262ff3bc Skip running in special buffers. 2013-04-02 15:30:58 +03:00
Martin Grenfell
78f345bab3 extract the vim work around code out to be more explicit
Add an explaining variable and a comment for the vcol workaround. See
issue #588
2013-03-28 23:28:41 +00:00
Martin Grenfell
46cd844a55 Merge remote-tracking branch 'lcd047/vcol' 2013-03-28 23:23:26 +00:00
Martin Grenfell
19a502d3ba bugfix for sourcing the syntastic class files
Fixes #543.

Use `runtime!` to source all runtime files - not just the first one
found. I actually dont know how syntastic was working at all without
this...
2013-03-28 23:04:58 +00:00
LCD 47
ec386f6b5d Bug fix. 2013-03-28 23:11:05 +02:00
LCD 47
b9dc0829ef Fixes the sparse checker.
Also allows %v to be used in errorformat.
2013-03-27 16:06:47 +02:00
Martin Grenfell
bf99882563 Merge pull request #262 from powerman/E855-on-lclose
Fix E855 on :lclose
2013-03-25 02:49:32 -07:00
Yosuke ONOUE
01ce9e3daf Fixed error on SyntasticToggleMode. 2013-03-25 14:16:58 +09:00
Martin Grenfell
d35e273d33 move the modemap code out into its own class 2013-03-22 22:50:47 +00:00
Martin Grenfell
925ba796c9 move the sign options into the sign class file 2013-03-22 18:08:27 +00:00
Martin Grenfell
84aae9b87f fix some guards 2013-03-22 18:07:50 +00:00
Martin Grenfell
5dfde8e151 add syntastic_always_populate_loc_list option
We dont want to set the loc list by default since syntastic isnt the
only plugin using loclists - and we dont want to clobber other peoples
loclists.

This option allows the user to override this behaviour if it suits their
workflow.
2013-03-21 17:46:14 +00:00
Martin Grenfell
6193c99f69 extract the sign code out into its own class 2013-03-21 17:46:13 +00:00
Martin Grenfell
fd90fdf9f4 SyntasticChecker: extract out the highlight regex population code 2013-03-18 10:01:56 +00:00
LCD 47
0906a5c5d1 Cleanup: a simpler and more efficient approach. 2013-03-18 10:01:56 +00:00
Harsh Doshi
3d736681ea redraw! causes screen flicker in mvim too 2013-03-15 17:20:41 -07:00
Martin Grenfell
75a234231b fix sign highlight groups
Seems that `:sign define ... texthl=bar` causes `hlexists('bar')` to
return true.

So set up the highlight groups before the signs - otherwise they will
never be set up by default.
2013-03-08 17:50:24 +00:00
Christian Höltje
2f4fc38053 Renamed version check function
Moved the `SyntasticIsVersionAtLeast()` into `util.vim` as
`syntastic#util#versionIsAtLeast()` as per @scrooloose's suggestion.
2013-03-08 11:58:49 -05:00
Christian Höltje
3dc0b6dc24 Made SyntacticIsVersionAtLeast more robust
It now handles more cases, which will cause Syntastic to degrade better
when commands return weird versions (e.g. the command crashes).
2013-03-08 11:51:39 -05:00
Martin Grenfell
034727a04c Merge pull request #528 from jszakmeister/add-highlight-groups
Add highlight groups for the signs and the lines.
2013-03-08 07:09:10 -08:00
Martin Grenfell
531a069c1a fix syntastic_auto_jump functionality
Previously we removed the code to automatically set the loclist and only
set it when required. This was needed because otherwise we could
interfere with other plugins that use the loclist.

Add the call to setloclist back in only if syntastic_auto_jump is set.
This will blow away the loclist every time the file is checked, but
setting syntastic_auto_jump is the users choice.

Fixes #533
2013-03-08 15:04:22 +00:00
LCD 47
ff3c05a413 Fix syntax highlighting.
The variable force_highlight_callback is gone.

Highlight functions are now consistently named
SyntaxCheckers_<filetype>_<checker>_GetHighlightRegex(), and they
take precedence over highlighting based on column.
2013-03-08 14:45:57 +00:00
David Barnett
a4a2867e8e Add support for buffer-local b:syntastic_checkers var. 2013-02-24 21:35:57 -08:00
John Szakmeister
10697a6952 Add highlight groups for the signs and the lines.
This allows users to customize the coloring of Syntastic's signs, and
also provides them a way to highlight the entire line using :sign's
linehl feature.  It preserves the current default behavior of using
the error and todo highlight groups if the customized ones aren't
present.  If the linehl group doesn't exist, then it's the same as not
specifying one, so no special highlighting for the line will occur.
2013-02-23 07:13:57 -05:00
Martin Grenfell
8cc63c729a be more strict with default checker settings
If a filetype has default checker settings, then only allow those
checkers to be used by default. The user must manually specify other
checkers to use if they dont want the default.

In future the `s:defaultCheckers` hash should be more complex (or
possibly an object) that allows us to specify "only" vs "preferred".

This change was made in response to the html filetype using the w3
checker when tidy is not installed.
2013-02-21 16:50:39 +00:00
Martin Grenfell
924cf68c2e add a function to get the active checker names for a filetype 2013-02-09 17:49:01 +00:00
Martin Grenfell
368505eb60 coffee: split up coffee and coffeelint 2013-02-06 13:59:27 +00:00
Martin Grenfell
9f08ff9cf6 html: only try to run tidy by default - not w3c
The w3c checker goes out to the internet to get its results so disable
it by default.
2013-02-06 13:47:41 +00:00
LCD 47
17641c0a49 Minor omission in commit 8f4695c. 2013-02-03 20:36:55 +02:00
Martin Grenfell
a66c19f731 move the MakeprgBuilder class in with the rest of the classes 2013-02-01 17:06:32 +00:00
Martin Grenfell
59cbf1c69e dont call setloclist() until the user calls :Errors 2013-02-01 16:52:11 +00:00
Martin Grenfell
0b0dbc56e6 dont allow checkers with duplicate names for the same filetype 2013-02-01 15:01:31 +00:00
Martin Grenfell
c97951b601 make a few refactors
Add CurrentFiletypes function as this logic was getting used in a couple
of places and needed a home/name - mostly because of the bizarre
substitute call that needs explanation.

Move the code to get a syntax checker by name into SyntasticRegistry
2013-02-01 14:38:53 +00:00
Martin Grenfell
0b3e074f8c Merge remote-tracking branch 'dbarnett/cmd_arg' 2013-02-01 14:18:31 +00:00
Martin Grenfell
8f4695c6de add a class to encapsulate loclists
Add SyntasticLoclist class to wrap up loclists, and move loclist query
methods from syntatic.vim to the new class.

Make SyntasticChecker#getLocList() return a SyntasticLoclist.
2013-02-01 14:17:55 +00:00
Martin Grenfell
f67d4881ca remove some old (now unused) code from the main plugin 2013-02-01 09:57:25 +00:00
David Barnett
40de98c2fc Add completion for checker name in :SyntasticCheck command 2013-01-31 23:36:41 -08:00
David Barnett
557321faae Support checker name as argument to :SyntasticCheck 2013-01-31 23:20:24 -08:00
Martin Grenfell
653611ccac split up php checker into php, phpmd and phpcs 2013-01-31 17:31:40 +00:00
Martin Grenfell
c166029fd8 add a couple more default checker settings 2013-01-31 10:52:15 +00:00
Martin Grenfell
a4a7b5697c update how checkers are chosen
* add a system for setting default checkers
* return the first check we find, unless told to chain checkers together
  by default settings, or user settings
2013-01-27 23:59:47 +00:00
Martin Grenfell
e0b8e87c93 refactor all the syntax checkers to use the new API and dir layout 2013-01-27 20:08:30 +00:00
Martin Grenfell
58ba8d3161 refactor how we represent and store checkers using python as a demo
Add 2 classes: SyntasticChecker and SyntasticRegistry.

SyntasticChecker represents a checker. It holds funcrefs to the checker
func, the highlight regex func and a new `isAvailable()` func (that
essentially just checks if the checker exe is installed)

SyntasticRegistry is responsible for:
* loading checkers
* storing checkers
* fetching the checkers to use according to availability and the users
  settings

Motivation/benefits:
* in the current system only one checker can be loaded per filetype
* syntax checkers cant be "chained" together
* the system is hard to add features to since fundamental concepts like
  syntax checkers and location lists arent represented explicitly

Things left to do:
* add a call to g:SyntasticRegistry.CreateAndRegisterChecker() to all
  checkers
* add an `isAvailable` function to all checkers
* move all checkers into `syntax_checkers/filetype/checkername.vim` -
  g:SyntasticRegistry assumes this layout, and its a good idea anyway
  for consistency and it makes it easier for users to add their own
  checkers

Things to do after all of the above:
* add a LocationList class and move all the filtering functions onto it
* possibly add an Error class that wraps up each item in a loc list

Random notes:
* with the new system you can select the checkers to use with e.g.
    `let g:syntastic_python_checkers=['flake8', 'pylint']`
  This will try flake8 first, and if no errors are detected it will move
  onto pylint.
2013-01-24 00:19:13 +00:00
Martin Grenfell
d48f43c222 wrap screen redrawing in a function to try and avoid screen flicker
Some versions of gvim flicker when `redraw!` is used. Use `redraw` for
them and use `redraw!` for terminal vim.

Fixes #449
2013-01-16 09:42:22 +00:00
Alex Efros
ccfdcef04d Merge branch 'master' into E855-on-lclose 2012-12-19 17:25:05 +02:00
Martin Grenfell
fc4ec2533c Merge branch 'load_any_checker' 2012-12-04 09:33:34 +00:00
Martin Grenfell
42480a01a1 modify SyntasticLoadChecker to load any checkers present
Previously we were only loading "official" checkers that had been added
to syntastic. Now we load any checker that is in the right directory.

This allows anyone to add custom checkers to any filetype that uses
`SyntasticLoadChecker()`
2012-12-03 21:22:44 +00:00
Martin Grenfell
7fe3ac44c2 allow custom checkers by just defining a checking function
Problem: users want to define their own checking function and not use
the syntastic defaults

Solution: dont load the syntastic default if a checking function
already exists. This way users can just define their own function and
override syntastic.

e.g. the user wants to have their own ruby checker, so in their vimrc
they just add:

    function! SyntaxCheckers_ruby_GetLocList()
        return SyntasticMake({"some custom stuff"})
    endfunction
2012-12-03 10:59:11 +00:00
David Barnett
b209693a2a Only set g:loaded_FT_syntax_checker if unset 2012-11-27 07:43:42 -08:00
David Barnett
dcac33ecc0 Set g:loaded_FOO_syntax_checker in syntastic.vim, not every ft file. 2012-11-26 21:44:43 -08:00
Martin Grenfell
36db8f4b16 fix a bug with highlighting and getmatches
Highlighting requires vim >= 7.1 with patch 40. It should be disabled
otherwise.

Fix a bug with the version check.

Closes #250.
2012-11-17 20:15:45 +00:00
Charles Lehner
3199ca3235 Explain why tabs are converted to spaces in error messages. 2012-10-25 20:01:31 -04:00
Charles Lehner
57e962865f Prevent tabs in error messages from causing "press enter" prompt.
Convert the tabs to spaces so that they are counted towards the window width
and the status message does not wrap.
2012-10-25 17:20:07 -04:00
Martin Grenfell
33427121ec fix a bug introduced in 60a3588d30
Two different calculations were incorrectly combined in
s:OSSupportsShellpipeHack().

Introduce s:IsRedrawRequiredAfterMake() to hold the other calculation.

Closes #388
2012-10-23 23:05:00 +01:00
Richard Brown
6382dc2124 Put getmatches check in a more sensible place 2012-10-01 15:10:53 +01:00
Richard Brown
ca1d129b3f s/HightlightErrors/HighlightErrors/g 2012-09-27 13:45:14 +01:00
Richard Brown
4bb4ec6550 Highlighting requires vim-7.1.040
Fixes Issue #250
2012-09-27 13:44:45 +01:00
Martin Grenfell
9849a6b8ac move s:uname() in with the rest of the functions - close to its usage 2012-09-24 18:53:15 +01:00
Martin Grenfell
9ccef501e9 Merge remote-tracking branch 'cehoffman/master'
Conflicts:
	plugin/syntastic.vim
2012-09-24 18:52:18 +01:00
Richard Brown
87f10e54d4 Make IsVersionAtLeast global 2012-09-22 19:51:12 +01:00
Martin Grenfell
127422c11e move SyntasticCheckable() down with the other public functions 2012-09-18 00:41:36 +01:00
Martin Grenfell
171776140b Merge remote-tracking branch 'rbrown/sh2'
Conflicts:
	syntax_checkers/sh.vim
2012-09-18 00:20:15 +01:00
Martin Grenfell
70f8354420 Merge pull request #318 from dstanek/master
Fixes issue #311
2012-09-07 02:35:15 -07:00
Richard Brown
0140f4baca Add syntax checker for ft=zsh
The current sh.vim checks for ft=sh and #!/bin/zsh  This add a checker
specifically for ft=zsh and changes sh.vim to call the same code.
2012-09-06 09:53:34 +01:00
Jamie Wong
98437c8752 Always update the location list, even if empty 2012-08-25 01:41:05 -04:00
David Stanek
2bad8761fa Fixes #311: errors not showing up in statusline
s:Errors() function loops through the location list lookin for errors
and caches the result. The function is called indirectly by
SynasticStatuslineFlag before the location list has content. This patch
ensures s:Errors only gets called if location list has content.
2012-08-10 03:23:46 -04:00
Martin Grenfell
1fb8366456 Merge pull request #244 from mootoh/master
Javascript syntax check with Google Closure Compiler
2012-07-28 09:43:42 -07:00
Martin Grenfell
cdd36c6479 populate the location list when :Errors is called
The location list must be set when calling :Errors since our cached
error list is associated with the buffer, but the vim loclist is
associated with the window.

So if the user closes a window, the vim loclist will get destroyed, but
our error list will still exist.

Closes #263
2012-07-24 12:25:16 +01:00
Arnout Kazemier
5ec845ea0d Added configuration option for the symbols that are used in the signs.
This allows users to configure their own indicators symbols
2012-07-17 16:05:51 +02:00
Martin Grenfell
60a3588d30 refactor the checks for the shell/shellpipe hack compatability
move the check into its own function to DRY up the code and add an
intention revealing name to the if statements
2012-07-01 22:48:54 +01:00
Alex Efros
f7e91e821f Fix E855 on :lclose
Since 7.3.449 trying to :lclose inside BufWinLeave result in E855:

    $ vi -u /dev/null --noplugin -N
    :autocmd BufWinLeave * if empty(&bt) | lclose | endif
    :lexpr(':1:msg') | lopen | wincmd p | lclose
    E855: Autocommands caused command to abort

    $ vi -u /dev/null --noplugin -N
    :autocmd BufWinLeave * if empty(&bt) | lclose | endif
    :lexpr(':1:msg') | lopen | wincmd p | q
    E855: Autocommands caused command to abort

Another issue with this autocmd is &bt in BufWinLeave may be different from
the buffer being unloaded (this is documented behaviour for BufWinLeave).
Replacing &bt with getbufvar(0+expand('<abuf>'), '&bt') solve this, but
doesn't fix issue with E855 completely (first of above examples with
:lclose is fixed, but second with :q is not fixed).

So, to work around E855 I've changed way to close location-list:
instead of closing it on BufWinLeave, it's closed on BufEnter into
location-list window if it's only buffer in current window.
2012-05-26 15:19:28 +03:00
Aaron Bieber
e315263ba6 Add fix for OpenBSD 2012-05-25 12:53:21 -06:00
Chris Hoffman
98b7e0e01b Delay an expensive startup cost until needed 2012-05-08 09:58:06 -05:00
Hong Xu
30d7462249 Remove some unnecessary win64 checks.
has('win32') is always true on Win64.
2012-05-08 20:31:20 +08:00
Motohiro Takayama
b94510fea3 Do not check if the syntax_checker exists and is executable.
Syntax checker name should be the filename of the syntax_checkers/*.vim.
It can be any filename, and can be the name which does not exist in the PATH.
2012-05-07 12:23:51 -07:00
Martin Grenfell
5c7f2b800d Merge pull request #227 from mschulkind/master
Stop clobbering global variables
2012-04-20 07:15:30 -07:00
Matthew Schulkind
4611645c18 Stop clobbering global options. 2012-04-20 10:11:07 -04:00
Florent Bruneau
999d3c1bb3 Only keep "valid" entries in the error count.
The location list returned by getloclist() may contain entries that are
not errorformat matches. By "definition", (see :help getqflist), matched
lines have the attribute "valid": 1 set, so only keep those lines in
error/warning list to avoid erroneous counts and strange behaviors.

Signed-off-by: Florent Bruneau <florent.bruneau@intersec.com>
2012-03-28 19:48:54 +02:00
Martin Grenfell
3c569d2b97 pass a filetype to SyntasticLoadChecker
This is needed to handle compound filetypes since we cant imply the
location of the syntax checker file from the filetype.

e.g. we want to load `syntax_checkers/python/pylint.vim`, but the
filetype is `python.django`. Previously this was causing `runtime
syntax_checkers/python.django/pylint.vim` to be executed.
2012-03-21 09:42:11 +00:00
Bram Schoenmakers
a6be206b71 Safely fetch the 'col' key of an error, it may not exist.
Since commit 892cc2, errors appeared on screen for example when checking
shell scripts.
2012-03-20 22:41:33 +01:00
Martin Grenfell
892cc2c232 refactor the error highlighting system
* remove the public SyntasticHighlightErrors() function
* shift the above code into s:HighlightErrors(). This is called
  automatically if g:syntastic_enable_highlighting is set
* to get the highlight regex we just look for a function called
  Syntastic_<filetype>_GetHighlightRegex
* to force this function to be called, each error item must have the
  'force_highlight_callback' key set

This code has one important functional change: now errors are *always*
highlighted if possible whereas previously they were only highlighted if
a call to SyntasticHighlightErrors was made.
2012-03-02 10:05:15 +00:00
Martin Grenfell
b4a7d47294 performance improvements: cache errors and warnings explicitly
There are many calls to s:Errors() and s:Warnings(), and previously the
location list was filtered once for each of these calls. This made vim
unusable when handling large location lists (with hundreds of entries).
Now we cache the errors and warnings explicitly when we cache the
location list.

Rework some of the minor methods so that they call s:Errors() or
s:Warnings() (which use the cached data) instead of calling
s:FilterLocList() directly (which is expensive).
2012-02-18 16:01:17 +00:00
Martin Grenfell
e44494558f minor performance improvements to the statusline function 2012-02-18 15:38:42 +00:00
Martin Grenfell
9594d34003 performance improvements for FilterLocList()
Remove the call to deepcopy() and use some alternative logic instead.

This improves performance massively for large location lists. More
aggressive caching is needed really though since this function is called
multiple times to return the same data.
2012-02-18 15:36:44 +00:00
Martin Grenfell
3e80184d5f bump to v2.3.0 and update changelog and credits 2012-02-16 17:20:03 +00:00
Martin Grenfell
9a6895d28d add syntastic_loc_list_height option
This allows the user to specify what height the loc list should be
opened at. Solves  issue #153.
2012-02-10 17:56:32 +00:00
Martin Grenfell
b30a9fad9a update some comments to reflect the new subtype functionality 2012-02-08 13:31:20 +00:00
Martin Grenfell
0de450de20 simplify how the 'subtype' option is added to errors
this is just a refactor to make things simpler and shorter
2012-02-08 13:31:20 +00:00
Martin Grenfell
2b514d84bd Merge pull request #158 from technosophos/master
Support for subtypes
2012-02-07 08:31:54 -08:00
Matt Butcher
516b2eec4f Per #158: Removed SubtypeMasksType.
Because the subtype checker is never run when an error is found,
this is not necessary anymore.
2012-02-07 10:02:21 -06:00
Martin Grenfell
fa1084cf8f DRY up the code that loads checkers when multiple exist
Javascript and json have multiple syntax checkers that can be loaded.
Previously the logic to determine which checker to load was basically
copied and pasted in both. The `go` checker will soon have more
than one option too so remove the duplication by sticking the
common code in the core.
2012-02-06 17:46:08 +00:00
Matt Butcher
8df5c3bcdc Added support for error/warning subtyping. 2012-01-27 13:43:48 -06:00
Martin Grenfell
54896becd3 bump to 2.2.0 and update changelog 2011-12-24 11:31:19 +00:00
Martin Grenfell
466f762841 add a ! to a function def 2011-12-24 11:05:51 +00:00
Martin Grenfell
d88db85b07 refactor g:syntastic_check_on_open
init g:syntastic_check_on_open with the rest of the options - this means
we only check exists("...") once rather than every time the autocmd is
run. Plus it reads better IMO.
2011-12-24 09:44:01 +00:00
kongo2002
9a9da94494 evaluate g:syntastic_check_on_open without having to restart vim 2011-12-24 01:33:07 +01:00
Martin Grenfell
9633837e16 dont do syntax checks when opening buffers
Only do syntax checks when saving files. Add the g:syntax_check_on_open
option to force the check when opening.

See #134
2011-12-23 23:46:39 +00:00
Martin Grenfell
7fe7900c8b refactor s:AutoToggleLocList()
move some code out of AutoToggleLocList and into UpdateErrors so that
AutoToggleLocList is only responsible for displaying/hiding the location
list window
2011-12-23 13:56:49 +00:00
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
Matthew Batema
f4177a3236 Counter-hack to provide screen redraw on FreeBSD
I'd attempted to find something useful in the sh/csh/tcsh man pages to
get similar shell redirection that &>/>& does, but it appears that all
fds are redirected, not just stderr and stdout.
2011-09-19 13:10:53 -07:00
Nate Jones
bb37d47018 add command to force a syntastic check
This allows a particular file type to be disabled but still be checked
when desired.  Useful for syntax checks that take a few seconds like the
puppet one.
2011-09-09 17:46:56 -07:00
Pavel Argentov
6b2fd05b66 FreeBSD shell workaround 2011-08-16 21:46:39 +04:00
Martin Grenfell
08e61a8c94 automatically update errors when enabling/disabling syntax checkers
If a user uses :SyntasticEnable or :SyntasticDisable, update the errors
for the buffer automatically if possible
2011-07-12 10:59:41 +12:00
Martin Grenfell
714392db16 only load syntax checker plugins when needed
This reduces the number of unnecessary files that get sourced.
2011-07-04 23:48:26 +12:00
Konstantin Stepanov
0bd7218382 Issue #44 fixed 2011-05-27 00:44:55 +03:00
Konstantin Stepanov
74f3bb0a93 balloons support 2011-05-03 02:21:16 +03:00
Martin Grenfell
219d02f4d7 add an option to allow users to format the statusline flag
Add the syntastic_stl_format flag and doc it under
:help syntastic_stl_format. This allows the user to control what
information is displayed in the syntastic statusline flag.
2011-02-19 20:10:20 +13:00
Martin Grenfell
6f18a97b0f set shell back regardless of whether we are running windows
This is purely in the interests of keeping the code simple.
2011-02-18 10:02:31 +13:00
Brian Donovan
e0d7338bdb Make sure we specify the shell to use since '&>' doesn't work in all shells. 2011-02-17 12:53:53 -08:00
Donald Ephraim Curtis
fc2a2e1134 Simplify the auto_loc_list options.
Don't allow "full_auto" and "semi_auto".
2011-02-15 21:49:54 -06:00
Donald Ephraim Curtis
ffae882541 slight modification to auto_loc_list behavior
g:syntastic_auto_loc now has the following possible options:

1 or "full_auto" or "fully_auto" behaves as normal, closing the loclist
when there are no errors and opening when there are errors.

2 or "semi_auto" will automatically close the loclist but _not_
automatically open it.
2011-02-15 21:45:44 -06:00
Martin Grenfell
09d0a091f0 move the syntastic_jsl_conf option out of the core plugin
Move this variable out of syntastic.vim since we dont the core plugin
shouldn't know any details of how the individual syntax checkers work.
2011-02-15 19:49:13 +13:00
Bryan Forbes
5bc6c2226f Added option to pass a config file to jsl. 2011-02-14 20:59:35 -06:00
Martin Grenfell
e2f8d56bc4 fix a bug with s:ErrorsForType()
compare the error type case insensitively since we cant know whether
errors will have a type of 'E' or 'e'
2011-02-12 01:15:00 +13:00
Donald Ephraim Curtis
e30ee7ce8b Fixed the problem with closing the Errors window and then wanting to
re-open it.  This error occurs when g:syntastic_auto_loc_list is
enabled.
2011-02-05 12:09:41 +13:00
Donald Ephraim Curtis
aebfc62a3b Silence the :ll command when auto_jump is enabled.
The message for the current error was being displayed when :ll was being
called.  Put a silent call to suppress output.
2011-02-05 12:09:27 +13:00
Donald Ephraim Curtis
9e6ad47d71 Add an option to jump to the first error. 2011-02-05 12:09:20 +13:00
Donald Ephraim Curtis
ddd858d8c1 Make it so that Loccation List is always populated.
Previously, the location list didn't get populated unless the Errors
window was displayed.  As a consequence there is no way to use :lnext
and :lprev to navigate the errors.  This makes it so that the list is
populated if there are new errors/warnings.
2011-02-05 12:08:56 +13:00
marty
4b690ba5e2 switch to version 1.2.0 and update the changelog 2010-10-28 23:13:34 +13:00
marty
97d6937dd4 only sign errors for the current buffer 2010-09-10 21:20:04 +12:00
marty
4e31dc1eb0 switch to version 1.1.0 2009-12-16 23:34:40 +13:00
marty
5ad3cd67c1 change my email to gmail, hotmail licks ass crack 2009-12-16 23:02:36 +13:00
marty
5ea36cb882 add commands to disable/enable syntax checking per filetype
Add these:
    :SyntasticDisable [filetype]
    :SyntasticEnable [filetype]

[filetype] defaults to the current filetype.

Add functions to bind the commands to.

Add g:syntastic_disabled_filetypes option to specify which filetypes
are disable by default.
2009-09-20 22:49:59 +12:00
Tim Pope
c83e196c84 Don't automatically focus quickfix window 2009-09-14 23:24:31 +12:00
marty
6b6546c8cc dont use :signs if vim wasnt compiled with them 2009-09-13 18:41:47 +12:00
marty
9712de9a47 remove bogus info from a method comment 2009-09-13 18:38:10 +12:00
marty
564496ed5a switch to version 1.0.0 2009-08-11 21:11:51 +12:00
Martin Grenfell
1cde42cb23 rename a var for consistency 2009-07-29 16:07:04 +12:00
Martin Grenfell
4b769b1dbe add syntastic_quiet_warnings option 2009-07-20 22:26:03 +12:00
Martin Grenfell
b8d2430814 add a doc file, remove the doc from the top of the script 2009-07-18 23:41:04 +12:00
Martin Grenfell
3dee539a2e some minor cleanups 2009-07-17 16:13:27 +12:00
Tim Carey-Smith
33d7086c34 Only auto-display the loclist if there are errors, but not if there are only warnings
Signed-off-by: Martin Grenfell <martin_grenfell@msn.com>
2009-07-17 12:09:27 +08:00
Martin Grenfell
0e98aa36c4 add SyntasticMake() to wrap up the :lmake procedure 2009-07-15 21:28:44 +12:00
Martin Grenfell
62abcf0b3d fix a typo 2009-07-15 19:34:17 +12:00
Martin Grenfell
1d3a963ee2 use todo hl group for warnings (looks better) 2009-07-15 19:23:02 +12:00
Martin Grenfell
89ec27e97f add a note about syntastic_auto_loc_list 2009-07-14 21:43:33 +12:00
Martin Grenfell
7fc70a741d place different signs for warnings 2009-07-14 14:10:47 +12:00
Martin Grenfell
378f74287f render new signs before deleting the old ones
this stops the sign column from flickering on and off
2009-07-14 13:47:46 +12:00
Martin Grenfell
7f60f42a2a add a todo note about the use of lclose 2009-07-13 23:23:04 +12:00
Martin Grenfell
03f4bd521e fix typo in a comment 2009-07-13 23:13:22 +12:00
Martin Grenfell
33fd1d9cd8 use location list instead of quicklist 2009-07-13 23:12:18 +12:00
Martin Grenfell
624c0b370b add sntastic_auto_copen option 2009-07-13 21:38:50 +12:00
Martin Grenfell
68d6ac09a2 refresh errors on bufreadpost instead of filetype
this is to stop the multiple syntax checking invocations that were
occurring when &ft was being detected as compound eg ruby.sinatra. i.e.
the ft was getting set as ruby, then another autocommand was resetting
it to ruby.sinatra, causing the syntax checking to be run twice.
2009-07-12 12:13:06 +12:00
Martin Grenfell
23a3edb4ed check all subfiletypes if &ft = "foo.bar" 2009-07-12 12:07:26 +12:00
Martin Grenfell
f2eb99d374 reset the next sign id after clearing signs 2009-07-12 01:35:29 +12:00
Martin Grenfell
75a06c41b0 update example syntax checker in blurb 2009-07-11 16:48:37 +12:00
Martin Grenfell
3d74f6df47 add a note about the stl flag to the blurb 2009-07-11 16:22:23 +12:00
Martin Grenfell
256b4225f2 update the blurb 2009-07-11 15:57:03 +12:00
Martin Grenfell
29ae4163b6 make the :sign stuff optional 2009-07-11 13:47:17 +12:00
Martin Grenfell
daa53659bd add a blurb at the top 2009-07-11 13:39:39 +12:00
Martin Grenfell
fa76e28947 rearrange some code and add comments 2009-07-11 11:55:51 +12:00
Martin Grenfell
20f7bb0d10 initial hacks 2009-07-11 11:09:52 +12:00