syntastic/autoload/syntastic.vim

24 lines
746 B
VimL
Raw Normal View History

2011-05-02 19:21:16 -04:00
function! syntastic#ErrorBalloonExpr()
if !exists('b:syntastic_balloons') | return '' | endif
return get(b:syntastic_balloons, v:beval_lnum, '')
endfunction
2011-05-03 08:35:50 -04:00
function! syntastic#HighlightErrors(errors, termfunc)
call clearmatches()
for item in a:errors
if item['col']
2011-05-24 21:50:12 -04:00
let lastcol = col([item['lnum'], '$'])
let lcol = min([lastcol, item['col']])
2011-05-03 08:35:50 -04:00
call matchadd('SpellBad', '\%'.item['lnum'].'l\%'.lcol.'c')
else
let group = item['type'] == 'E' ? 'SpellBad' : 'SpellCap'
let term = a:termfunc(item)
if len(term) > 0
call matchadd(group, '\%' . item['lnum'] . 'l' . term)
endif
endif
endfor
endfunction