Skip to content

Commit

Permalink
Fix infinity loop in FindParentVCSRoot (preservim#1095)
Browse files Browse the repository at this point in the history
* Fix infinity loop in FindParentVCSRoot (on windows os with 'set shellslash' in vimrc and no VCS in path)

* update CHANGELOG.md

* Update CHANGELOG.md

Co-Authored-By: Phil Runninger <PhilRunninger@users.noreply.github.com>

Co-authored-by: evgenij.vidershpan <evgenij.vidershpan@yandex.ru>
Co-authored-by: Phil Runninger <PhilRunninger@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 26, 2020
1 parent 495b4e7 commit 343508e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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
- **.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
Expand Down
4 changes: 2 additions & 2 deletions nerdtree_plugin/vcs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ endfunction
function! s:FindParentVCSRoot(path)
let l:path = a:path
while !empty(l:path) &&
\ l:path._str() !~# '^\(\a:\\\|\/\)$' &&
\ l:path._str() !~# '^\(\a:[\\\/]\|\/\)$' &&
\ !isdirectory(l:path._str() . '/.git') &&
\ !isdirectory(l:path._str() . '/.svn') &&
\ !isdirectory(l:path._str() . '/.hg') &&
\ !isdirectory(l:path._str() . '/.bzr') &&
\ !isdirectory(l:path._str() . '/_darcs')
let l:path = l:path.getParent()
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

0 comments on commit 343508e

Please sign in to comment.