Sets the status line of the location window.

Shows the command used to produce the error list on the status line of
the location window.  Also fixed a (harmless) refresh bug.
This commit is contained in:
LCD 47 2013-06-07 00:34:05 +03:00
parent c1de9703ff
commit 4c888855d6
2 changed files with 24 additions and 1 deletions

View File

@ -135,7 +135,6 @@ function! s:UpdateErrors(auto_invoked, ...)
end
let loclist = g:SyntasticLoclist.current()
call s:notifiers.refresh(loclist)
if g:syntastic_always_populate_loc_list || g:syntastic_auto_jump
call setloclist(0, loclist.filteredRaw())
@ -143,6 +142,8 @@ function! s:UpdateErrors(auto_invoked, ...)
silent! lrewind
endif
endif
call s:notifiers.refresh(loclist)
endfunction
"clear the loc list for the buffer
@ -178,6 +179,7 @@ function! s:CacheErrors(...)
if !loclist.isEmpty()
let newLoclist = newLoclist.extend(loclist)
call newLoclist.setName(checker.getName())
"only get errors from one checker at a time
break

View File

@ -23,6 +23,8 @@ function! g:SyntasticLoclist.New(rawLoclist)
let newObj._rawLoclist = llist
let newObj._hasErrorsOrWarningsToDisplay = -1
let newObj._name = ''
return newObj
endfunction
@ -59,6 +61,14 @@ function! g:SyntasticLoclist.getLength()
return len(self._rawLoclist)
endfunction
function! g:SyntasticLoclist.getName()
return len(self._name)
endfunction
function! g:SyntasticLoclist.setName(name)
let self._name = a:name
endfunction
function! g:SyntasticLoclist.hasErrorsOrWarningsToDisplay()
if self._hasErrorsOrWarningsToDisplay >= 0
return self._hasErrorsOrWarningsToDisplay
@ -140,6 +150,17 @@ function! g:SyntasticLoclist.show()
if num != winnr()
wincmd p
endif
" try to find the loclist window and set w:quickfix_title
for buf in tabpagebuflist()
if buflisted(buf) && bufloaded(buf) && getbufvar(buf, '&buftype') ==# 'quickfix'
let win = bufwinnr(buf)
let title = getwinvar(win, 'quickfix_title', '')
if title ==# ':setloclist()' || strpart(title, 0, 16) ==# ':SyntasticCheck '
call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name)
endif
endif
endfor
endif
endfunction