mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f767dd34a0 | ||
|
|
832bbaa729 | ||
|
|
343508e9fd | ||
|
|
495b4e781a | ||
|
|
e67324fdea | ||
|
|
5249b30fbf | ||
|
|
09b165cfac | ||
|
|
6224d20698 | ||
|
|
07612557eb | ||
|
|
7a0312f492 | ||
|
|
41a44be8d5 |
@@ -4,7 +4,14 @@
|
|||||||
version in an unordered list. The format is:
|
version in an unordered list. The format is:
|
||||||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||||
-->
|
-->
|
||||||
|
#### 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)
|
||||||
|
- **.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
|
||||||
|
- **.1**: [add] How to install using dein.vim (kazukazuinaina) [#1087](https://github.com/preservim/nerdtree/pull/1087)
|
||||||
- **.0**: Add the ability to turn off directory arrows (PhilRunninger) [#1085](https://github.com/preservim/nerdtree/pull/1085)
|
- **.0**: Add the ability to turn off directory arrows (PhilRunninger) [#1085](https://github.com/preservim/nerdtree/pull/1085)
|
||||||
#### 6.5
|
#### 6.5
|
||||||
- **.0**: `NERDTreeToggle <start-directory>` always sets NERDTree root. (PhilRunninger) [#1083](https://github.com/preservim/nerdtree/pull/1083)
|
- **.0**: `NERDTreeToggle <start-directory>` always sets NERDTree root. (PhilRunninger) [#1083](https://github.com/preservim/nerdtree/pull/1083)
|
||||||
|
|||||||
@@ -59,6 +59,13 @@ Plug 'preservim/nerdtree'
|
|||||||
call plug#end()
|
call plug#end()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### [dein.vim](https://github.com/Shougo/dein.vim)
|
||||||
|
```vim
|
||||||
|
call dein#begin()
|
||||||
|
call dein#add('preservim/nerdtree')
|
||||||
|
call dein#end()
|
||||||
|
```
|
||||||
|
|
||||||
#### [apt-vim](https://github.com/egalpin/apt-vim)
|
#### [apt-vim](https://github.com/egalpin/apt-vim)
|
||||||
```bash
|
```bash
|
||||||
apt-vim install -y https://github.com/preservim/nerdtree.git
|
apt-vim install -y https://github.com/preservim/nerdtree.git
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ endfunction
|
|||||||
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
||||||
function! s:findAndRevealPath(pathStr) abort
|
function! s:findAndRevealPath(pathStr) abort
|
||||||
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
|
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
|
||||||
|
let l:revealOpts = {}
|
||||||
|
|
||||||
if empty(l:pathStr)
|
if empty(l:pathStr)
|
||||||
call nerdtree#echoWarning('no file for the current buffer')
|
call nerdtree#echoWarning('no file for the current buffer')
|
||||||
@@ -292,6 +293,7 @@ function! s:findAndRevealPath(pathStr) abort
|
|||||||
|
|
||||||
if !filereadable(l:pathStr)
|
if !filereadable(l:pathStr)
|
||||||
let l:pathStr = fnamemodify(l:pathStr, ':h')
|
let l:pathStr = fnamemodify(l:pathStr, ':h')
|
||||||
|
let l:revealOpts['open'] = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -327,7 +329,7 @@ function! s:findAndRevealPath(pathStr) abort
|
|||||||
call b:NERDTree.ui.setShowHidden(1)
|
call b:NERDTree.ui.setShowHidden(1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:node = b:NERDTree.root.reveal(l:pathObj)
|
let l:node = b:NERDTree.root.reveal(l:pathObj, l:revealOpts)
|
||||||
call b:NERDTree.render()
|
call b:NERDTree.render()
|
||||||
call l:node.putCursorHere(1, 0)
|
call l:node.putCursorHere(1, 0)
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -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 . "'"
|
||||||
|
|||||||
@@ -209,7 +209,8 @@ function! NERDTreeMoveNode()
|
|||||||
|
|
||||||
try
|
try
|
||||||
if curNode.path.isDirectory
|
if curNode.path.isDirectory
|
||||||
let l:openBuffers = filter(range(1,bufnr('$')),'bufexists(v:val) && fnamemodify(bufname(v:val),":p") =~# curNode.path.str() . "/.*"')
|
let l:curPath = escape(curNode.path.str(),'\') . (nerdtree#runningWindows()?'\\':'/') . '.*'
|
||||||
|
let l:openBuffers = filter(range(1,bufnr('$')),'bufexists(v:val) && fnamemodify(bufname(v:val),":p") =~# "'.escape(l:curPath,'\').'"')
|
||||||
else
|
else
|
||||||
let l:openBuffers = filter(range(1,bufnr('$')),'bufexists(v:val) && fnamemodify(bufname(v:val),":p") ==# curNode.path.str()')
|
let l:openBuffers = filter(range(1,bufnr('$')),'bufexists(v:val) && fnamemodify(bufname(v:val),":p") ==# curNode.path.str()')
|
||||||
endif
|
endif
|
||||||
@@ -387,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