]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | function! syntastic#ErrorBalloonExpr() | |
3 | if !exists('b:syntastic_balloons') | return '' | endif | |
4 | return get(b:syntastic_balloons, v:beval_lnum, '') | |
5 | endfunction | |
6 | ||
7 | function! syntastic#HighlightErrors(errors, termfunc, ...) | |
8 | call clearmatches() | |
9 | let forcecb = a:0 && a:1 | |
10 | for item in a:errors | |
11 | let group = item['type'] == 'E' ? 'SpellBad' : 'SpellCap' | |
12 | if item['col'] && !forcecb | |
13 | let lastcol = col([item['lnum'], '$']) | |
14 | let lcol = min([lastcol, item['col']]) | |
15 | call matchadd(group, '\%'.item['lnum'].'l\%'.lcol.'c') | |
16 | else | |
17 | let term = a:termfunc(item) | |
18 | if len(term) > 0 | |
19 | call matchadd(group, '\%' . item['lnum'] . 'l' . term) | |
20 | endif | |
21 | endif | |
22 | endfor | |
23 | endfunction | |
24 |