mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -4,7 +4,14 @@
|
||||
version in an unordered list. The format is:
|
||||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||
-->
|
||||
#### 6.8
|
||||
- **.0**: Allow concealed characters to show another character. (PhilRunninger) [#1138](https://github.com/preservim/nerdtree/pull/1138)
|
||||
#### 6.7
|
||||
- **.15**: Add curly braces to the list of characters to be escaped. (PhilRunninger) [#1128](https://github.com/preservim/nerdtree/pull/1128)
|
||||
- **.14**: Use backward-compatible `nerdtree#and()` in one place that was missed. (PhilRunninger) [#1134](https://github.com/preservim/nerdtree/pull/1134)
|
||||
- **.13**: `cmd.exe /c start "" <filename>` for windows default viewer support. (J. Altayó) [#1130](https://github.com/preservim/nerdtree/pull/1130)
|
||||
- **.12**: Fixed a bug that caused the file-tree construction to slow down significantly. (Eugenij-W) [#1126](https://github.com/preservim/nerdtree/pull/1126)
|
||||
- **.11**: Fix exception in NERDTreeFind (on windows OS and If the file is located in the root directory of the disk) (Eugenij-W) [#1122](https://github.com/preservim/nerdtree/pull/1122)
|
||||
- **.10**: Do not consider the tree root to be "cascadable". (lifecrisis) [#1120](https://github.com/preservim/nerdtree/pull/1120)
|
||||
- **.9**: Force `:NERDTreeFocus` to allow events to be fired when switching windows. (PhilRunninger) [#1118](https://github.com/preservim/nerdtree/pull/1118)
|
||||
- **.8**: Fix example code for the `NERDTreeAddKeyMap()` function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116)
|
||||
|
@ -45,7 +45,7 @@ function! nerdtree#slash() abort
|
||||
endfunction
|
||||
|
||||
"FUNCTION: nerdtree#and(x,y) {{{2
|
||||
" Implements and() function for Vim <= 7.2
|
||||
" Implements and() function for Vim <= 7.4
|
||||
function! nerdtree#and(x,y) abort
|
||||
if exists('*and')
|
||||
return and(a:x, a:y)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -431,6 +431,7 @@ function! s:TreeDirNode._initChildren(silent)
|
||||
endtry
|
||||
endfor
|
||||
|
||||
let g:NERDTreeOldSortOrder = g:NERDTreeSortOrder
|
||||
call self.sortChildren()
|
||||
|
||||
call nerdtree#echo('')
|
||||
|
@ -34,6 +34,10 @@ if executable('xdg-open')
|
||||
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileLinux'})
|
||||
endif
|
||||
|
||||
if nerdtree#runningWindows()
|
||||
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileWindows'})
|
||||
endif
|
||||
|
||||
if g:NERDTreePath.CopyingSupported()
|
||||
call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
|
||||
endif
|
||||
@ -451,4 +455,15 @@ function! NERDTreeExecuteFileLinux()
|
||||
call system('xdg-open ' . shellescape(l:node.path.str()))
|
||||
endfunction
|
||||
|
||||
" FUNCTION: NERDTreeExecuteFileWindows() {{{1
|
||||
function! NERDTreeExecuteFileWindows()
|
||||
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||
|
||||
if empty(l:node)
|
||||
return
|
||||
endif
|
||||
|
||||
call system('cmd.exe /c start "" ' . shellescape(l:node.path.str()))
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -22,7 +22,7 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
|
||||
"highlighting to conceal the delimiter around the file/dir name
|
||||
if has('conceal')
|
||||
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# conceal containedin=ALL'
|
||||
setlocal conceallevel=3 concealcursor=nvic
|
||||
setlocal conceallevel=2 concealcursor=nvic
|
||||
else
|
||||
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# containedin=ALL'
|
||||
hi! link NERDTreeNodeDelimiters Ignore
|
||||
|
Reference in New Issue
Block a user