Fixes handling of g:syntastic_quiet_warnings.
This commit is contained in:
parent
bd226bb026
commit
878bceaac7
@ -132,11 +132,11 @@ function! s:UpdateErrors(auto_invoked, ...)
|
|||||||
|
|
||||||
let loclist = s:LocList()
|
let loclist = s:LocList()
|
||||||
if g:syntastic_always_populate_loc_list && loclist.hasErrorsOrWarningsToDisplay()
|
if g:syntastic_always_populate_loc_list && loclist.hasErrorsOrWarningsToDisplay()
|
||||||
call setloclist(0, loclist.toRaw())
|
call setloclist(0, loclist.filteredRaw())
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:syntastic_auto_jump && loclist.hasErrorsOrWarningsToDisplay()
|
if g:syntastic_auto_jump && loclist.hasErrorsOrWarningsToDisplay()
|
||||||
call setloclist(0, loclist.toRaw())
|
call setloclist(0, loclist.filteredRaw())
|
||||||
silent! ll
|
silent! ll
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -224,8 +224,8 @@ endfunction
|
|||||||
"display the cached errors for this buf in the location list
|
"display the cached errors for this buf in the location list
|
||||||
function! s:ShowLocList()
|
function! s:ShowLocList()
|
||||||
let loclist = s:LocList()
|
let loclist = s:LocList()
|
||||||
if !loclist.isEmpty()
|
if loclist.hasErrorsOrWarningsToDisplay()
|
||||||
call setloclist(0, loclist.toRaw())
|
call setloclist(0, loclist.filteredRaw())
|
||||||
let num = winnr()
|
let num = winnr()
|
||||||
exec "lopen " . g:syntastic_loc_list_height
|
exec "lopen " . g:syntastic_loc_list_height
|
||||||
if num != winnr()
|
if num != winnr()
|
||||||
@ -254,7 +254,7 @@ function! s:HighlightErrors()
|
|||||||
let fts = substitute(&ft, '-', '_', 'g')
|
let fts = substitute(&ft, '-', '_', 'g')
|
||||||
for ft in split(fts, '\.')
|
for ft in split(fts, '\.')
|
||||||
|
|
||||||
for item in loclist.toRaw()
|
for item in loclist.filteredRaw()
|
||||||
let group = item['type'] == 'E' ? 'SyntasticError' : 'SyntasticWarning'
|
let group = item['type'] == 'E' ? 'SyntasticError' : 'SyntasticWarning'
|
||||||
|
|
||||||
if has_key(item, 'hl')
|
if has_key(item, 'hl')
|
||||||
@ -287,7 +287,7 @@ function! s:RefreshBalloons()
|
|||||||
let b:syntastic_balloons = {}
|
let b:syntastic_balloons = {}
|
||||||
let loclist = s:LocList()
|
let loclist = s:LocList()
|
||||||
if loclist.hasErrorsOrWarningsToDisplay()
|
if loclist.hasErrorsOrWarningsToDisplay()
|
||||||
for i in loclist.toRaw()
|
for i in loclist.filteredRaw()
|
||||||
let b:syntastic_balloons[i['lnum']] = i['text']
|
let b:syntastic_balloons[i['lnum']] = i['text']
|
||||||
endfor
|
endfor
|
||||||
set beval bexpr=SyntasticErrorBalloonExpr()
|
set beval bexpr=SyntasticErrorBalloonExpr()
|
||||||
@ -409,7 +409,7 @@ function! SyntasticStatuslineFlag()
|
|||||||
let output = substitute(output, '\C%t', loclist.length(), 'g')
|
let output = substitute(output, '\C%t', loclist.length(), 'g')
|
||||||
|
|
||||||
"first error/warning line num
|
"first error/warning line num
|
||||||
let output = substitute(output, '\C%F', loclist.toRaw()[0]['lnum'], 'g')
|
let output = substitute(output, '\C%F', loclist.filteredRaw()[0]['lnum'], 'g')
|
||||||
|
|
||||||
"first error line num
|
"first error line num
|
||||||
let output = substitute(output, '\C%fe', num_errors ? errors[0]['lnum'] : '', 'g')
|
let output = substitute(output, '\C%fe', num_errors ? errors[0]['lnum'] : '', 'g')
|
||||||
|
@ -21,6 +21,7 @@ function! g:SyntasticLoclist.New(rawLoclist)
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
let newObj._rawLoclist = llist
|
let newObj._rawLoclist = llist
|
||||||
|
let newObj._hasErrorsOrWarningsToDisplay = -1
|
||||||
|
|
||||||
return newObj
|
return newObj
|
||||||
endfunction
|
endfunction
|
||||||
@ -35,6 +36,10 @@ function! g:SyntasticLoclist.toRaw()
|
|||||||
return copy(self._rawLoclist)
|
return copy(self._rawLoclist)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! g:SyntasticLoclist.filteredRaw()
|
||||||
|
return copy(self._quietWarnings ? self.errors() : self._rawLoclist)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! g:SyntasticLoclist.isEmpty()
|
function! g:SyntasticLoclist.isEmpty()
|
||||||
return empty(self._rawLoclist)
|
return empty(self._rawLoclist)
|
||||||
endfunction
|
endfunction
|
||||||
@ -44,10 +49,11 @@ function! g:SyntasticLoclist.length()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! g:SyntasticLoclist.hasErrorsOrWarningsToDisplay()
|
function! g:SyntasticLoclist.hasErrorsOrWarningsToDisplay()
|
||||||
if empty(self._rawLoclist)
|
if self._hasErrorsOrWarningsToDisplay >= 0
|
||||||
return 0
|
return self._hasErrorsOrWarningsToDisplay
|
||||||
endif
|
endif
|
||||||
return len(self.errors()) || !self._quietWarnings
|
let self._hasErrorsOrWarningsToDisplay = empty(self._rawLoclist) ? 0 : (!self._quietWarnings || len(self.errors()))
|
||||||
|
return self._hasErrorsOrWarningsToDisplay
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! g:SyntasticLoclist.errors()
|
function! g:SyntasticLoclist.errors()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user