This commit is contained in:
Joel Rocha 2021-12-13 15:56:27 -05:00 committed by GitHub
commit a5fcce3c13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,6 +118,11 @@ fun! s:RgRootDir()
let l:cwd = getcwd() let l:cwd = getcwd()
let l:dirs = split(getcwd(), '/') let l:dirs = split(getcwd(), '/')
"If NERDTree is open get the root of it to use as a path
if exists('b:NERDTree')
let l:root = b:NERDTree.root.path.str()
return l:root
else
for l:dir in reverse(copy(l:dirs)) for l:dir in reverse(copy(l:dirs))
for l:type in g:rg_root_types for l:type in g:rg_root_types
let l:path = s:RgMakePath(l:dirs, l:dir) let l:path = s:RgMakePath(l:dirs, l:dir)
@ -126,6 +131,7 @@ fun! s:RgRootDir()
endif endif
endfor endfor
endfor endfor
endif
return l:cwd return l:cwd
endfun endfun