1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 17:45:00 +08:00

Updated plugins

This commit is contained in:
Amir
2020-06-21 11:50:44 -04:00
parent 1d312d3252
commit e83f5ea2e7
46 changed files with 470 additions and 152 deletions

View File

@ -249,7 +249,11 @@ function! s:Creator._pathForString(str)
if dir =~# '^\.'
let dir = getcwd() . g:NERDTreePath.Slash() . dir
endif
let dir = g:NERDTreePath.Resolve(dir)
"hack to prevent removing slash if dir is the root of the file system.
if dir !=# '/'
let dir = g:NERDTreePath.Resolve(dir)
endif
try
let path = g:NERDTreePath.New(dir)

View File

@ -219,7 +219,7 @@ endfunction
" FUNCTION: Opener._openFile() {{{1
function! s:Opener._openFile()
if !self._stay && !and(g:NERDTreeQuitOnOpen,1) && exists('b:NERDTreeZoomed') && b:NERDTreeZoomed
if !self._stay && !nerdtree#and(g:NERDTreeQuitOnOpen,1) && exists('b:NERDTreeZoomed') && b:NERDTreeZoomed
call b:NERDTree.ui.toggleZoom()
endif

View File

@ -332,7 +332,7 @@ function! s:Path._escChars()
return " `\|\"#%&,?()\*^<>$"
endif
return " \\`\|\"#%&,?()\*^<>[]$"
return " \\`\|\"#%&,?()\*^<>[]{}$"
endfunction
" FUNCTION: Path.getDir() {{{1
@ -546,26 +546,36 @@ endfunction
" return 1 if this path is somewhere above the given path in the filesystem.
"
" a:path should be a dir
function! s:Path.isAncestor(path)
if !self.isDirectory
return 0
endif
let this = self.str()
let that = a:path.str()
return stridx(that, this) ==# 0
function! s:Path.isAncestor(child)
return a:child.isUnder(self)
endfunction
" FUNCTION: Path.isUnder(path) {{{1
" return 1 if this path is somewhere under the given path in the filesystem.
function! s:Path.isUnder(path)
if a:path.isDirectory ==# 0
function! s:Path.isUnder(parent)
if a:parent.isDirectory ==# 0
return 0
endif
let this = self.str()
let that = a:path.str()
return stridx(this, that . s:Path.Slash()) ==# 0
if nerdtree#runningWindows() && a:parent.drive !=# self.drive
return 0
endif
let l:this_count = len(self.pathSegments)
if l:this_count ==# 0
return 0
endif
let l:that_count = len(a:parent.pathSegments)
if l:that_count ==# 0
return 1
endif
if l:that_count >= l:this_count
return 0
endif
for i in range(0, l:that_count-1)
if self.pathSegments[i] !=# a:parent.pathSegments[i]
return 0
endif
endfor
return 1
endfunction
" FUNCTION: Path.JoinPathStrings(...) {{{1

View File

@ -431,6 +431,7 @@ function! s:TreeDirNode._initChildren(silent)
endtry
endfor
let g:NERDTreeOldSortOrder = g:NERDTreeSortOrder
call self.sortChildren()
call nerdtree#echo('')