mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated vim plugins
This commit is contained in:
@ -33,7 +33,7 @@ function! s:Creator._broadcastInitEvent()
|
||||
silent doautocmd User NERDTreeInit
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:Creator.BufNamePrefix() {{{2
|
||||
" FUNCTION: s:Creator.BufNamePrefix() {{{1
|
||||
function! s:Creator.BufNamePrefix()
|
||||
return 'NERD_tree_'
|
||||
endfunction
|
||||
|
@ -49,7 +49,7 @@ endfunction
|
||||
|
||||
"FUNCTION: MenuController._echoPrompt() {{{1
|
||||
function! s:MenuController._echoPrompt()
|
||||
echo "NERDTree Menu. Use j/k/enter and the shortcuts indicated"
|
||||
echo "NERDTree Menu. Use " . g:NERDTreeMenuDown . "/" . g:NERDTreeMenuUp . "/enter and the shortcuts indicated"
|
||||
echo "=========================================================="
|
||||
|
||||
for i in range(0, len(self.menuItems)-1)
|
||||
@ -71,9 +71,9 @@ endfunction
|
||||
"change the selection (if appropriate) and return 1 if the user has made
|
||||
"their choice, 0 otherwise
|
||||
function! s:MenuController._handleKeypress(key)
|
||||
if a:key == 'j'
|
||||
if a:key == g:NERDTreeMenuDown
|
||||
call self._cursorDown()
|
||||
elseif a:key == 'k'
|
||||
elseif a:key == g:NERDTreeMenuUp
|
||||
call self._cursorUp()
|
||||
elseif a:key == nr2char(27) "escape
|
||||
let self.selection = -1
|
||||
|
@ -254,6 +254,13 @@ function! s:TreeDirNode.getChildIndex(path)
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeDirNode.getDirChildren() {{{1
|
||||
" Return a list of all child nodes from "self.children" that are of type
|
||||
" TreeDirNode. This function supports http://github.com/scrooloose/nerdtree-project-plugin.git.
|
||||
function! s:TreeDirNode.getDirChildren()
|
||||
return filter(copy(self.children), 'v:val.path.isDirectory == 1')
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeDirNode._glob(pattern, all) {{{1
|
||||
" Return a list of strings naming the descendants of the directory in this
|
||||
" TreeDirNode object that match the specified glob pattern.
|
||||
@ -370,12 +377,26 @@ function! s:TreeDirNode.hasVisibleChildren()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeDirNode.isCascadable() {{{1
|
||||
" true if this dir has only one visible child - which is also a dir
|
||||
" true if this dir has only one visible child that is also a dir
|
||||
" false if this dir is bookmarked or symlinked. Why? Two reasons:
|
||||
" 1. If cascaded, we don't know which dir is bookmarked or is a symlink.
|
||||
" 2. If the parent is a symlink or is bookmarked, you end up with unparsable
|
||||
" text, and NERDTree cannot get the path of any child node.
|
||||
function! s:TreeDirNode.isCascadable()
|
||||
if g:NERDTreeCascadeSingleChildDir == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
if self.path.isSymLink
|
||||
return 0
|
||||
endif
|
||||
|
||||
for i in g:NERDTreeBookmark.Bookmarks()
|
||||
if i.path.equals(self.path)
|
||||
return 0
|
||||
endif
|
||||
endfor
|
||||
|
||||
let c = self.getVisibleChildren()
|
||||
return len(c) == 1 && c[0].path.isDirectory
|
||||
endfunction
|
||||
|
Reference in New Issue
Block a user