Merge remote-tracking branch 'scrooloose/master'
This commit is contained in:
commit
09eb954a44
@ -106,7 +106,7 @@ function! s:ErrorsForType(type)
|
|||||||
if !exists("b:syntastic_loclist")
|
if !exists("b:syntastic_loclist")
|
||||||
return []
|
return []
|
||||||
endif
|
endif
|
||||||
return filter(copy(b:syntastic_loclist), 'v:val["type"] ==# "' . a:type . '"')
|
return filter(copy(b:syntastic_loclist), 'v:val["type"] ==? "' . a:type . '"')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if g:syntastic_enable_signs
|
if g:syntastic_enable_signs
|
||||||
|
@ -20,13 +20,17 @@ if !executable("lessc")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
function! SyntaxCheckers_less_GetLocList()
|
function! SyntaxCheckers_less_GetLocList()
|
||||||
let output = system("lessc " . shellescape(expand("%")))
|
let makeprg = 'lessc '. shellescape(expand('%'))
|
||||||
if v:shell_error != 0
|
let errorformat = 'Syntax %trror on line %l,! Syntax %trror: on line %l: %m,%-G%.%#'
|
||||||
"less only outputs the first error, so parse it ourselves
|
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||||
let line = substitute(output, '^! Syntax Error: on line \(\d*\):.*$', '\1', '')
|
|
||||||
let msg = substitute(output, '^! Syntax Error: on line \d*:\(.*\)$', '\1', '')
|
|
||||||
return [{'lnum' : line, 'text' : msg, 'bufnr': bufnr(""), 'type': 'E' }]
|
|
||||||
endif
|
|
||||||
return []
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
for i in errors
|
||||||
|
let i['bufnr'] = bufnr("")
|
||||||
|
|
||||||
|
if empty(i['text'])
|
||||||
|
let i['text'] = "Syntax error"
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return errors
|
||||||
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user