syntastic/autoload/syntastic.vim

25 lines
783 B
VimL
Raw Normal View History

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