mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 19:33:50 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f767dd34a0 | ||
|
|
832bbaa729 | ||
|
|
343508e9fd |
@@ -5,6 +5,9 @@
|
|||||||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||||
-->
|
-->
|
||||||
#### 6.7
|
#### 6.7
|
||||||
|
- **.4**: Add missing calls to the `shellescape()` function (lifecrisis) [#1099](https://github.com/preservim/nerdtree/pull/1099)
|
||||||
|
- **.3**: Fix vsplit to not open empty buffers when opening previously closed file (AwkwardKore) [#1098](https://github.com/preservim/nerdtree/pull/1098)
|
||||||
|
- **.2**: Fix infinity loop (on winvim) in FindParentVCSRoot (Eugenij-W) [#1095](https://github.com/preservim/nerdtree/pull/1095)
|
||||||
- **.1**: File Move: Escape existing directory name when looking for open files. (PhilRunninger) [#1094](https://github.com/preservim/nerdtree/pull/1094)
|
- **.1**: File Move: Escape existing directory name when looking for open files. (PhilRunninger) [#1094](https://github.com/preservim/nerdtree/pull/1094)
|
||||||
- **.0**: Open the parent directory when revealing a non-existent file with :NERDTreeFind (bouk) [#1090](https://github.com/preservim/nerdtree/pull/1090)
|
- **.0**: Open the parent directory when revealing a non-existent file with :NERDTreeFind (bouk) [#1090](https://github.com/preservim/nerdtree/pull/1090)
|
||||||
#### 6.6
|
#### 6.6
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ function! s:Opener._newVSplit()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
call nerdtree#exec('wincmd p', 1)
|
call nerdtree#exec('wincmd p', 1)
|
||||||
call nerdtree#exec('vnew', 1)
|
call nerdtree#exec('vsplit', 1)
|
||||||
|
|
||||||
let l:currentWindowNumber = winnr()
|
let l:currentWindowNumber = winnr()
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ function! s:Path.copy(dest)
|
|||||||
let cmd_prefix = (self.isDirectory ? g:NERDTreeCopyDirCmd : g:NERDTreeCopyFileCmd)
|
let cmd_prefix = (self.isDirectory ? g:NERDTreeCopyDirCmd : g:NERDTreeCopyFileCmd)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let cmd = cmd_prefix . ' ' . escape(self.str(), self._escChars()) . ' ' . escape(a:dest, self._escChars())
|
let cmd = cmd_prefix . ' ' . shellescape(self.str()) . ' ' . shellescape(a:dest)
|
||||||
let success = system(cmd)
|
let success = system(cmd)
|
||||||
if v:shell_error !=# 0
|
if v:shell_error !=# 0
|
||||||
throw "NERDTree.CopyError: Could not copy '". self.str() ."' to: '" . a:dest . "'"
|
throw "NERDTree.CopyError: Could not copy '". self.str() ."' to: '" . a:dest . "'"
|
||||||
|
|||||||
@@ -388,44 +388,67 @@ endfunction
|
|||||||
|
|
||||||
" FUNCTION: NERDTreeQuickLook() {{{1
|
" FUNCTION: NERDTreeQuickLook() {{{1
|
||||||
function! NERDTreeQuickLook()
|
function! NERDTreeQuickLook()
|
||||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||||
if treenode !=# {}
|
|
||||||
call system("qlmanage -p 2>/dev/null '" . treenode.path.str() . "'")
|
if empty(l:node)
|
||||||
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call system('qlmanage -p 2>/dev/null ' . shellescape(l:node.path.str()))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: NERDTreeRevealInFinder() {{{1
|
" FUNCTION: NERDTreeRevealInFinder() {{{1
|
||||||
function! NERDTreeRevealInFinder()
|
function! NERDTreeRevealInFinder()
|
||||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||||
if treenode !=# {}
|
|
||||||
call system("open -R '" . treenode.path.str() . "'")
|
if empty(l:node)
|
||||||
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call system('open -R ' . shellescape(l:node.path.str()))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: NERDTreeExecuteFile() {{{1
|
" FUNCTION: NERDTreeExecuteFile() {{{1
|
||||||
function! NERDTreeExecuteFile()
|
function! NERDTreeExecuteFile()
|
||||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||||
if treenode !=# {}
|
|
||||||
call system("open '" . treenode.path.str() . "'")
|
if empty(l:node)
|
||||||
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call system('open ' . shellescape(l:node.path.str()))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: NERDTreeRevealFileLinux() {{{1
|
" FUNCTION: NERDTreeRevealFileLinux() {{{1
|
||||||
function! NERDTreeRevealFileLinux()
|
function! NERDTreeRevealFileLinux()
|
||||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||||
let parentnode = treenode.parent
|
|
||||||
if parentnode !=# {}
|
if empty(l:node)
|
||||||
call system("xdg-open '" . parentnode.path.str() . "' &")
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Handle the edge case of "/", which has no parent.
|
||||||
|
if l:node.path.str() ==# '/'
|
||||||
|
call system('xdg-open /')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if empty(l:node.parent)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
call system('xdg-open ' . shellescape(l:node.parent.path.str()))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: NERDTreeExecuteFileLinux() {{{1
|
" FUNCTION: NERDTreeExecuteFileLinux() {{{1
|
||||||
function! NERDTreeExecuteFileLinux()
|
function! NERDTreeExecuteFileLinux()
|
||||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||||
if treenode !=# {}
|
|
||||||
call system("xdg-open '" . treenode.path.str() . "' &")
|
if empty(l:node)
|
||||||
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call system('xdg-open ' . shellescape(l:node.path.str()))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim: set sw=4 sts=4 et fdm=marker:
|
" vim: set sw=4 sts=4 et fdm=marker:
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ endfunction
|
|||||||
function! s:FindParentVCSRoot(path)
|
function! s:FindParentVCSRoot(path)
|
||||||
let l:path = a:path
|
let l:path = a:path
|
||||||
while !empty(l:path) &&
|
while !empty(l:path) &&
|
||||||
\ l:path._str() !~# '^\(\a:\\\|\/\)$' &&
|
\ l:path._str() !~# '^\(\a:[\\\/]\|\/\)$' &&
|
||||||
\ !isdirectory(l:path._str() . '/.git') &&
|
\ !isdirectory(l:path._str() . '/.git') &&
|
||||||
\ !isdirectory(l:path._str() . '/.svn') &&
|
\ !isdirectory(l:path._str() . '/.svn') &&
|
||||||
\ !isdirectory(l:path._str() . '/.hg') &&
|
\ !isdirectory(l:path._str() . '/.hg') &&
|
||||||
@@ -42,6 +42,6 @@ function! s:FindParentVCSRoot(path)
|
|||||||
\ !isdirectory(l:path._str() . '/_darcs')
|
\ !isdirectory(l:path._str() . '/_darcs')
|
||||||
let l:path = l:path.getParent()
|
let l:path = l:path.getParent()
|
||||||
endwhile
|
endwhile
|
||||||
return (empty(l:path) || l:path._str() =~# '^\(\a:\\\|\/\)$') ? a:path : l:path
|
return (empty(l:path) || l:path._str() =~# '^\(\a:[\\\/]\|\/\)$') ? a:path : l:path
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user