Merge branch 'master' into gcc_refactor

This commit is contained in:
LCD 47 2013-06-21 20:50:40 +03:00
commit 8c9ed2da1b
4 changed files with 18 additions and 18 deletions

View File

@ -111,7 +111,7 @@ e.g. Previously there was `g:syntastic_phpcs_conf`, now you must use `g:syntasti
See `:help syntastic-checker-options` for more information.
__Q. I run a chacker and the location list is not updated...__
__Q. I run a checker and the location list is not updated...__
A. By default, the location list is changed only when you run the `:Errors` command, in order to minimise conflicts with other plugins. If you want the location list to always be updated when you run the checkers, add this line to your vimrc:
```vim

View File

@ -100,8 +100,7 @@ endif
function! s:BufWinEnterHook()
if empty(&bt)
let loclist = g:SyntasticLoclist.current()
call g:SyntasticAutoloclistNotifier.AutoToggle(loclist)
call g:SyntasticHighlightingNotifier.refresh(loclist)
call s:notifiers.refresh(loclist)
endif
endfunction

View File

@ -17,16 +17,17 @@ function! g:SyntasticCursorNotifier.New()
endfunction
function! g:SyntasticCursorNotifier.refresh(loclist)
autocmd! syntastic CursorMoved
let enabled = exists('b:syntastic_echo_current_error') ? b:syntastic_echo_current_error : g:syntastic_echo_current_error
if enabled && a:loclist.hasErrorsOrWarningsToDisplay()
let b:syntastic_messages = copy(a:loclist.messages())
let b:syntastic_messages = copy(a:loclist.messages(bufnr('')))
let b:oldLine = -1
autocmd! syntastic CursorMoved
autocmd syntastic CursorMoved * call g:SyntasticRefreshCursor()
endif
endfunction
function! g:SyntasticCursorNotifier.reset(loclist)
autocmd! syntastic CursorMoved
unlet! b:syntastic_messages
let b:oldLine = -1
endfunction

View File

@ -92,26 +92,26 @@ function! g:SyntasticLoclist.warnings()
endfunction
" cache used by EchoCurrentError()
function! g:SyntasticLoclist.messages()
function! g:SyntasticLoclist.messages(buf)
if !exists("self._cachedMessages")
let self._cachedMessages = {}
let errors = self.errors() + (self._quietWarnings ? [] : self.warnings())
for e in self.errors()
if !has_key(self._cachedMessages, e['lnum'])
let self._cachedMessages[e['lnum']] = e['text']
for e in errors
let b = e['bufnr']
let l = e['lnum']
if !has_key(self._cachedMessages, b)
let self._cachedMessages[b] = {}
endif
endfor
if !self._quietWarnings
for e in self.warnings()
if !has_key(self._cachedMessages, e['lnum'])
let self._cachedMessages[e['lnum']] = e['text']
if !has_key(self._cachedMessages[b], l)
let self._cachedMessages[b][l] = e['text']
endif
endfor
endif
endif
return self._cachedMessages
return get(self._cachedMessages, a:buf, {})
endfunction
"Filter the list and return new native loclist