syntastic/autoload/syntastic.vim
Konstantin Stepanov 0bd7218382 Issue #44 fixed
2011-05-27 00:44:55 +03:00

24 lines
746 B
VimL

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()
for item in a:errors
if item['col']
let lastcol = col([item['lnum'], '$'])
let lcol = min([lastcol, item['col']])
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