mirror of
https://github.com/jremmen/vim-ripgrep.git
synced 2026-01-29 02:17:12 +08:00
Merge ec81748e5f into 2bb2425387
This commit is contained in:
commit
a5fcce3c13
1 changed files with 23 additions and 17 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue