mirror of
https://github.com/amix/vimrc
synced 2025-06-16 17:45:00 +08:00
Updated plugins
This commit is contained in:
@ -256,7 +256,7 @@ endfunction
|
||||
function! s:Bookmark.open(nerdtree, ...)
|
||||
let opts = a:0 ? a:1 : {}
|
||||
|
||||
if nerdtree#and(g:NERDTreeQuitOnOpen,2)
|
||||
if nerdtree#closeBookmarksOnOpen()
|
||||
call a:nerdtree.ui.toggleShowBookmarks()
|
||||
endif
|
||||
|
||||
|
@ -51,7 +51,7 @@ function! s:KeyMap.bind()
|
||||
else
|
||||
let keymapInvokeString = self.key
|
||||
endif
|
||||
let keymapInvokeString = escape(keymapInvokeString, '\')
|
||||
let keymapInvokeString = escape(keymapInvokeString, '\"')
|
||||
|
||||
let premap = self.key ==# '<LeftRelease>' ? ' <LeftRelease>' : ' '
|
||||
|
||||
@ -66,11 +66,11 @@ endfunction
|
||||
"FUNCTION: KeyMap.invoke() {{{1
|
||||
"Call the KeyMaps callback function
|
||||
function! s:KeyMap.invoke(...)
|
||||
let Callback = type(self.callback) ==# type(function('tr')) ? self.callback : function(self.callback)
|
||||
let l:Callback = type(self.callback) ==# type(function('tr')) ? self.callback : function(self.callback)
|
||||
if a:0
|
||||
call Callback(a:1)
|
||||
call l:Callback(a:1)
|
||||
else
|
||||
call Callback()
|
||||
call l:Callback()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
@ -65,14 +65,6 @@ function! s:NERDTree.Close()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:NERDTree.CloseIfQuitOnOpen() {{{1
|
||||
"Closes the NERD tree window if the close on open option is set
|
||||
function! s:NERDTree.CloseIfQuitOnOpen()
|
||||
if nerdtree#and(g:NERDTreeQuitOnOpen,1) && s:NERDTree.IsOpen()
|
||||
call s:NERDTree.Close()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:NERDTree.CursorToBookmarkTable(){{{1
|
||||
"Places the cursor at the top of the bookmarks table
|
||||
function! s:NERDTree.CursorToBookmarkTable()
|
||||
|
@ -15,8 +15,8 @@ function! s:Notifier.NotifyListeners(event, path, nerdtree, params)
|
||||
let event = g:NERDTreeEvent.New(a:nerdtree, a:path, a:event, a:params)
|
||||
|
||||
for Listener in s:Notifier.GetListenersForEvent(a:event)
|
||||
let Callback = type(Listener) == type(function('tr')) ? Listener : function(Listener)
|
||||
call Callback(event)
|
||||
let l:Callback = type(Listener) == type(function('tr')) ? Listener : function(Listener)
|
||||
call l:Callback(event)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
|
@ -33,8 +33,7 @@ function! s:Opener._bufInWindows(bnum)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: Opener._checkToCloseTree(newtab) {{{1
|
||||
" Check the class options and global options (i.e. NERDTreeQuitOnOpen) to see
|
||||
" if the tree should be closed now.
|
||||
" Check the class options to see if the tree should be closed now.
|
||||
"
|
||||
" Args:
|
||||
" a:newtab - boolean. If set, only close the tree now if we are opening the
|
||||
@ -46,7 +45,7 @@ function! s:Opener._checkToCloseTree(newtab)
|
||||
endif
|
||||
|
||||
if (a:newtab && self._where ==# 't') || !a:newtab
|
||||
call g:NERDTree.CloseIfQuitOnOpen()
|
||||
call g:NERDTree.Close()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@ -218,7 +217,7 @@ endfunction
|
||||
|
||||
" FUNCTION: Opener._openFile() {{{1
|
||||
function! s:Opener._openFile()
|
||||
if !self._stay && !nerdtree#and(g:NERDTreeQuitOnOpen,1) && exists('b:NERDTreeZoomed') && b:NERDTreeZoomed
|
||||
if !self._stay && self._keepopen && get(b:, 'NERDTreeZoomed', 0)
|
||||
call b:NERDTree.ui.toggleZoom()
|
||||
endif
|
||||
|
||||
|
@ -394,7 +394,7 @@ function! s:Path.getSortKey()
|
||||
let self._sortKey = [self.getSortOrderIndex()] + metadata
|
||||
endif
|
||||
|
||||
let path = self.getLastPathComponent(1)
|
||||
let path = self.getLastPathComponent(0)
|
||||
if !g:NERDTreeSortHiddenFirst
|
||||
let path = substitute(path, '^[._]', '', '')
|
||||
endif
|
||||
@ -459,10 +459,10 @@ function! s:Path.ignore(nerdtree)
|
||||
endif
|
||||
endfor
|
||||
|
||||
for Callback in g:NERDTree.PathFilters()
|
||||
let Callback = type(Callback) ==# type(function('tr')) ? Callback : function(Callback)
|
||||
if Callback({'path': self, 'nerdtree': a:nerdtree})
|
||||
return 1
|
||||
for l:Callback in g:NERDTree.PathFilters()
|
||||
let l:Callback = type(l:Callback) ==# type(function('tr')) ? l:Callback : function(l:Callback)
|
||||
if l:Callback({'path': self, 'nerdtree': a:nerdtree})
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
@ -483,7 +483,10 @@ endfunction
|
||||
" returns true if this path matches the given ignore pattern
|
||||
function! s:Path._ignorePatternMatches(pattern)
|
||||
let pat = a:pattern
|
||||
if strpart(pat,len(pat)-7) ==# '[[dir]]'
|
||||
if strpart(pat,len(pat)-8) ==# '[[path]]'
|
||||
let pat = strpart(pat,0, len(pat)-8)
|
||||
return self.str() =~# pat
|
||||
elseif strpart(pat,len(pat)-7) ==# '[[dir]]'
|
||||
if !self.isDirectory
|
||||
return 0
|
||||
endif
|
||||
|
Reference in New Issue
Block a user