1
0
mirror of https://github.com/amix/vimrc synced 2025-07-21 03:44:59 +08:00

Updated plugins

This commit is contained in:
amix
2016-10-02 13:37:21 +02:00
parent 751af44cbe
commit aad95603ea
60 changed files with 1788 additions and 463 deletions

View File

@ -25,10 +25,27 @@ function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) abort " {{{2
call a:loclist.show()
endif
else
if auto_loc_list == 1 || auto_loc_list == 2
"TODO: this will close the loc list window if one was opened by
"something other than syntastic
lclose
if (auto_loc_list == 1 || auto_loc_list == 2) && !empty(get(w:, 'syntastic_loclist_set', []))
try
" Vim 7.4.2200 or later
let title = get(getloclist(0, { 'title': 1 }), 'title', ':SyntasticCheck ')
catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/
let title = ':SyntasticCheck '
endtry
if strpart(title, 0, 16) ==# ':SyntasticCheck '
" TODO: this will close the loc list window if one was opened
" by something other than syntastic
call SyntasticLoclistHide()
try
" Vim 7.4.2200 or later
call setloclist(0, [], 'r', { 'title': '' })
catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/
" do nothing
endtry
let w:syntastic_loclist_set = []
endif
endif
endif
endfunction " }}}2

View File

@ -27,17 +27,18 @@ function! g:SyntasticLoclist.New(rawLoclist) abort " {{{2
return newObj
endfunction " }}}2
function! g:SyntasticLoclist.current() abort " {{{2
if !exists('b:syntastic_loclist') || empty(b:syntastic_loclist)
let b:syntastic_loclist = g:SyntasticLoclist.New([])
function! g:SyntasticLoclist.current(...) abort " {{{2
let buf = a:0 > 1 ? a:1 : bufnr('')
let loclist = getbufvar(buf, 'syntastic_loclist')
if type(loclist) != type({}) || empty(loclist)
unlet! loclist
let loclist = g:SyntasticLoclist.New([])
endif
return b:syntastic_loclist
return loclist
endfunction " }}}2
function! g:SyntasticLoclist.extend(other) abort " {{{2
let list = self.copyRaw()
call extend(list, a:other.copyRaw())
return g:SyntasticLoclist.New(list)
call extend(self._rawLoclist, a:other.copyRaw())
endfunction " }}}2
function! g:SyntasticLoclist.sort() abort " {{{2
@ -167,7 +168,6 @@ function! g:SyntasticLoclist.setOwner(buffer) abort " {{{2
endfunction " }}}2
function! g:SyntasticLoclist.deploy() abort " {{{2
call self.setOwner(bufnr(''))
let self._stamp = syntastic#util#stamp()
for buf in self.getBuffers()
call setbufvar(buf, 'syntastic_loclist', self)
@ -289,23 +289,29 @@ function! g:SyntasticLoclist.filter(filters) abort " {{{2
return filter(copy(self._rawLoclist), filter)
endfunction " }}}2
function! g:SyntasticLoclist.setloclist() abort " {{{2
function! g:SyntasticLoclist.setloclist(new) abort " {{{2
if !exists('w:syntastic_loclist_set')
let w:syntastic_loclist_set = []
endif
if empty(w:syntastic_loclist_set) || w:syntastic_loclist_set != [bufnr(''), b:changedtick]
let replace = g:syntastic_reuse_loc_lists && !empty(w:syntastic_loclist_set)
if a:new || empty(w:syntastic_loclist_set) || w:syntastic_loclist_set != [self._owner, getbufvar(self._owner, 'changedtick')]
let replace = !a:new && g:syntastic_reuse_loc_lists && !empty(w:syntastic_loclist_set)
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist ' . (replace ? '(replace)' : '(new)'))
call setloclist(0, self.getRaw(), replace ? 'r' : ' ')
call syntastic#util#setChangedtick()
let w:syntastic_loclist_set = [bufnr(''), b:syntastic_changedtick]
try
" Vim 7.4.2200 or later
call setloclist(0, [], 'r', { 'title': ':SyntasticCheck ' . self._name })
catch /\m^Vim\%((\a\+)\)\=:E\%(118\|731\)/
" do nothing
endtry
call syntastic#util#setLastTick(self._owner)
let w:syntastic_loclist_set = [self._owner, getbufvar(self._owner, 'syntastic_lasttick')]
endif
endfunction " }}}2
"display the cached errors for this buf in the location list
function! g:SyntasticLoclist.show() abort " {{{2
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: show')
call self.setloclist()
call self.setloclist(0)
if !self.isEmpty()
let num = winnr()

View File

@ -72,7 +72,7 @@ function! g:SyntasticModeMap.echoMode() abort " {{{2
endfunction " }}}2
function! g:SyntasticModeMap.modeInfo(filetypes) abort " {{{2
echomsg 'Syntastic version: ' . g:_SYNTASTIC_VERSION . ' (Vim ' . v:version . ', ' . g:_SYNTASTIC_UNAME . ')'
echomsg 'Syntastic version: ' . g:syntastic_version
let type = len(a:filetypes) ? a:filetypes[0] : &filetype
echomsg 'Info for filetype: ' . type

View File

@ -23,7 +23,7 @@ function! g:SyntasticNotifiers.Instance() abort " {{{2
endfunction " }}}2
function! g:SyntasticNotifiers.refresh(loclist) abort " {{{2
if !a:loclist.isEmpty() && !a:loclist.isNewerThan([])
if !syntastic#util#bufIsActive(bufnr('')) || (!a:loclist.isEmpty() && !a:loclist.isNewerThan([]))
" loclist not fully constructed yet
return
endif

View File

@ -339,7 +339,10 @@ endfunction " }}}2
" Check for obsolete variable g:syntastic_<filetype>_checker
function! g:SyntasticRegistry._checkDeprecation(filetype) abort " {{{2
if exists('g:syntastic_' . a:filetype . '_checker') && !exists('g:syntastic_' . a:filetype . '_checkers')
if exists('g:syntastic_' . a:filetype . '_checker') &&
\ !exists('g:syntastic_' . a:filetype . '_checkers') &&
\ type(g:syntastic_{a:filetype}_checker) == type('')
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
call syntastic#log#oneTimeWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated')
endif