mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Fix infinity loop in FindParentVCSRoot (#1095)
* 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>
This commit is contained in:
@@ -34,7 +34,7 @@ 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') &&
|
||||
@@ -42,6 +42,6 @@ function! s:FindParentVCSRoot(path)
|
||||
\ !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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user