Open NERDTreeFind tree at CWD if current file is below it.
This commit is contained in:
parent
4dd1bc9ef6
commit
b3b394c329
@ -2562,7 +2562,18 @@ function! s:findAndRevealPath()
|
|||||||
endtry
|
endtry
|
||||||
|
|
||||||
if !s:treeExistsForTab()
|
if !s:treeExistsForTab()
|
||||||
call s:initNerdTree(p.getParent().str())
|
try
|
||||||
|
let cwd = s:Path.New(getcwd())
|
||||||
|
catch /^NERDTree.InvalidArgumentsError/
|
||||||
|
call s:echo("current directory does not exist.")
|
||||||
|
let cwd = p.getParent()
|
||||||
|
endtry
|
||||||
|
|
||||||
|
if p.isUnder(cwd)
|
||||||
|
call s:initNerdTree(cwd.str())
|
||||||
|
else
|
||||||
|
call s:initNerdTree(p.getParent().str())
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
if !p.isUnder(s:TreeFileNode.GetRootForTab().path)
|
if !p.isUnder(s:TreeFileNode.GetRootForTab().path)
|
||||||
call s:initNerdTree(p.getParent().str())
|
call s:initNerdTree(p.getParent().str())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user