Skip to content

Commit

Permalink
File Move: Escape existing directory name when looking for open files. (
Browse files Browse the repository at this point in the history
#1094)

* File Move: Escape existing directory name when looking for open files.

* Update version number in change log.

Co-authored-by: Phil Runninger <prunninger@vhtcx.com>
  • Loading branch information
PhilRunninger and Phil Runninger authored Mar 24, 2020
1 parent e67324f commit 495b4e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
-->
#### 6.7
- **.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
- **.1**: [add] How to install using dein.vim (kazukazuinaina) [#1087](https://github.com/preservim/nerdtree/pull/1087)
Expand Down
3 changes: 2 additions & 1 deletion nerdtree_plugin/fs_menu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ function! NERDTreeMoveNode()

try
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
let l:openBuffers = filter(range(1,bufnr('$')),'bufexists(v:val) && fnamemodify(bufname(v:val),":p") ==# curNode.path.str()')
endif
Expand Down

0 comments on commit 495b4e7

Please sign in to comment.