From 4c888855d650581bd78c83902d8d58f9b518b67c Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Fri, 7 Jun 2013 00:34:05 +0300 Subject: [PATCH] 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. --- plugin/syntastic.vim | 4 +++- plugin/syntastic/loclist.vim | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index f4b091c0..4f7cfba8 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -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 diff --git a/plugin/syntastic/loclist.vim b/plugin/syntastic/loclist.vim index 637c6b82..dbeff638 100644 --- a/plugin/syntastic/loclist.vim +++ b/plugin/syntastic/loclist.vim @@ -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