diff options
| author | Ben Beltran <ben@freshout.us> | 2012-10-08 11:44:10 -0500 |
|---|---|---|
| committer | Ben Beltran <ben@freshout.us> | 2012-10-08 11:44:10 -0500 |
| commit | 0d23b6e515a01a5782532351821ebfa11f3d6cf2 (patch) | |
| tree | aa395b7e50ccb533d6b48b809016ac06f2d5bc8c /vim/autoload/syntastic.vim | |
| parent | a91731eac872b7837c2821341db5888702125cef (diff) | |
Add vim again :)
Diffstat (limited to 'vim/autoload/syntastic.vim')
| -rw-r--r-- | vim/autoload/syntastic.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vim/autoload/syntastic.vim b/vim/autoload/syntastic.vim new file mode 100644 index 0000000..a477736 --- /dev/null +++ b/vim/autoload/syntastic.vim @@ -0,0 +1,24 @@ + +function! syntastic#ErrorBalloonExpr() + if !exists('b:syntastic_balloons') | return '' | endif + return get(b:syntastic_balloons, v:beval_lnum, '') +endfunction + +function! syntastic#HighlightErrors(errors, termfunc, ...) + call clearmatches() + let forcecb = a:0 && a:1 + for item in a:errors + let group = item['type'] == 'E' ? 'SpellBad' : 'SpellCap' + if item['col'] && !forcecb + let lastcol = col([item['lnum'], '$']) + let lcol = min([lastcol, item['col']]) + call matchadd(group, '\%'.item['lnum'].'l\%'.lcol.'c') + else + let term = a:termfunc(item) + if len(term) > 0 + call matchadd(group, '\%' . item['lnum'] . 'l' . term) + endif + endif + endfor +endfunction + |