@@ -142,8 +142,8 @@ function! s:GetBufferDirsList()
142
142
if empty (d )
143
143
let d = currDir
144
144
elseif has (" win32" ) && d [0 ] == " /"
145
- " Add the drive prefix and remove the trailing slash
146
- let d = fnamemodify (d , " :p: s-/$--" )
145
+ " Remove the trailing slash
146
+ let d = fnamemodify (d , " :s-/$--" )
147
147
endif
148
148
let dirs[d ]= 1
149
149
endfor
@@ -551,7 +551,7 @@ function! s:GetGrepRootEx()
551
551
endif
552
552
553
553
let type = " builtin"
554
- let pathtoreturn = s: GetCwdEscaped ()
554
+ let pathtoreturn = " . "
555
555
if ! exists (" g:EasyGrepRoot" )
556
556
" this is ok; act as if we are specified as "cwd"
557
557
elseif g: EasyGrepRoot == " cwd"
@@ -725,34 +725,14 @@ function! s:ApplySearchDirectoriesToFileTargetList(fileTargets)
725
725
let fileTargets = a: fileTargets
726
726
727
727
" Build a list of the directories in buffers
728
- let dirs = s: GetBufferDirsList ()
729
-
730
- let newlst = copy (fileTargets)
728
+ let dirs = s: GetDirectorySearchList ()
731
729
732
- let root = s: GetGrepRoot ()
733
- let currDir = s: GetCwdEscaped ()
734
- let accepteddirs = [ root ]
730
+ let newlst = []
735
731
for dir in dirs
736
- let addToList = 1
737
- if dir == ' .'
738
- let dir = currDir
739
- endif
740
- if dir == root
741
- let addToList = 0
742
- elseif s: IsRecursiveSearch ()
743
- for d in accepteddirs
744
- if s: IsRecursivelyReachable (d , dir )
745
- let addToList = 0
746
- break
747
- endif
748
- endfor
749
- endif
750
- if addToList
751
- call add (accepteddirs, dir )
752
- for p in fileTargets
753
- call add (newlst, dir ." /" .p )
754
- endfor
755
- endif
732
+ for target in fileTargets
733
+ let newTarget = dir == " ." ? target : dir ." /" .target
734
+ call add (newlst, newTarget)
735
+ endfor
756
736
endfor
757
737
758
738
return newlst
@@ -819,7 +799,8 @@ function! s:GetDirectorySearchList()
819
799
endfor
820
800
endif
821
801
if addToList
822
- call add (bufferSetList, s: FileEscape (dir ))
802
+ let escapedDir = s: FileEscape (dir )
803
+ call add (bufferSetList, escapedDir)
823
804
endif
824
805
let i += 1
825
806
endwhile
@@ -1060,6 +1041,7 @@ function! <sid>EchoGrepCommand()
1060
1041
let dirs = s: GetDirectorySearchList ()
1061
1042
let dirAnnotation = " Search Directory: "
1062
1043
for d in dirs
1044
+ let d = (d == " ." ) ? d ." --> " .s: GetCwdEscaped ()." " : d
1063
1045
call s: Echo (dirAnnotation.d )
1064
1046
let dirAnnotation = " Additional Directory: "
1065
1047
endfor
0 commit comments