Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If file path doesn't exist, :NERDTreeFind its parent directory instead. #1043

Merged
merged 3 commits into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

#### 6.1...
- **.0**: If file path doesn't exist, :NERDTreeFind its parent directory instead. (PhilRunninger) [#1043](https://github.com/scrooloose/nerdtree/pull/1043)
#### 6.0...
- **.1**: Reintroduce necessary variable mistakenly removed. (PhilRunninger) [#1040](https://github.com/scrooloose/nerdtree/pull/1040)
- **.0**: Make the behavior of window splits consistent (dragonxlwang, PhilRunninger) [#1035](https://github.com/scrooloose/nerdtree/pull/1035)
Expand Down
3 changes: 3 additions & 0 deletions autoload/nerdtree/ui_glue.vim
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ endfunction
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
function! s:findAndRevealPath(pathStr)
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
if !filereadable(l:pathStr)
let l:pathStr = fnamemodify(l:pathStr, ':h')
endif

if empty(l:pathStr)
call nerdtree#echoWarning('no file for the current buffer')
Expand Down