Skip to content

Commit 572b582

Browse files
committed
Adjust GetDirectorySearchList to take the project root and recursion into
account
1 parent f675dca commit 572b582

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

plugin/EasyGrep.vim

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,9 @@ function! s:GetDirectorySearchList()
818818
if s:IsRecursiveSearch()
819819
return s:GetRecursiveMinimalSetList()
820820
else
821-
return extend([s:GetGrepRoot()], s:GetBufferDirsList())
821+
let lst = [s:GetGrepRoot()]
822+
call s:AddBufferDirsToFileTargetList(lst)
823+
return lst
822824
endif
823825
else
824826
return [ s:GetGrepRoot() ]
@@ -2805,11 +2807,7 @@ function! s:GetGrepCommandLine(pattern, add, wholeword, count, escapeArgs)
28052807
let opts .= " " . join(map(fileTargetList, '"--include=\"" .v:val."\""'), ' '). " "
28062808

28072809
" while the files we specify will be directories
2808-
if g:EasyGrepSearchCurrentBufferDir
2809-
let fileTargetList = s:GetRecursiveMinimalSetList()
2810-
else
2811-
let fileTargetList = [ s:GetGrepRoot() ]
2812-
endif
2810+
let fileTargetList = s:GetDirectorySearchList()
28132811
endif
28142812
endif
28152813

0 commit comments

Comments
 (0)