@@ -2395,6 +2395,7 @@ function! s:GetGrepCommandParameters()
2395
2395
\ ' bufferdirsearchallowed' : ' 1' ,
2396
2396
\ ' backslashdir' : ' 0' ,
2397
2397
\ ' errorsuppress' : ' ' ,
2398
+ \ ' directoryneedsbackslash' : ' 0' ,
2398
2399
\ }
2399
2400
elseif s: IsCommandGrep ()
2400
2401
return {
@@ -2409,6 +2410,7 @@ function! s:GetGrepCommandParameters()
2409
2410
\ ' bufferdirsearchallowed' : ' !recursive' ,
2410
2411
\ ' backslashdir' : ' 0' ,
2411
2412
\ ' errorsuppress' : ' -s' ,
2413
+ \ ' directoryneedsbackslash' : ' 0' ,
2412
2414
\ }
2413
2415
elseif s: IsCommandGitGrep ()
2414
2416
return {
@@ -2423,6 +2425,7 @@ function! s:GetGrepCommandParameters()
2423
2425
\ ' bufferdirsearchallowed' : ' 0' ,
2424
2426
\ ' backslashdir' : ' 0' ,
2425
2427
\ ' errorsuppress' : ' ' ,
2428
+ \ ' directoryneedsbackslash' : ' 0' ,
2426
2429
\ }
2427
2430
elseif s: IsCommandAck ()
2428
2431
return {
@@ -2437,6 +2440,7 @@ function! s:GetGrepCommandParameters()
2437
2440
\ ' bufferdirsearchallowed' : ' 1' ,
2438
2441
\ ' backslashdir' : ' 0' ,
2439
2442
\ ' errorsuppress' : ' ' ,
2443
+ \ ' directoryneedsbackslash' : ' 0' ,
2440
2444
\ }
2441
2445
elseif s: IsCommandPt ()
2442
2446
return {
@@ -2451,6 +2455,7 @@ function! s:GetGrepCommandParameters()
2451
2455
\ ' bufferdirsearchallowed' : ' 1' ,
2452
2456
\ ' backslashdir' : ' 0' ,
2453
2457
\ ' errorsuppress' : ' ' ,
2458
+ \ ' directoryneedsbackslash' : ' 0' ,
2454
2459
\ }
2455
2460
elseif s: IsCommandFindstr ()
2456
2461
return {
@@ -2465,6 +2470,7 @@ function! s:GetGrepCommandParameters()
2465
2470
\ ' bufferdirsearchallowed' : ' 1' ,
2466
2471
\ ' backslashdir' : ' 1' ,
2467
2472
\ ' errorsuppress' : ' ' ,
2473
+ \ ' directoryneedsbackslash' : ' 1' ,
2468
2474
\ }
2469
2475
endif
2470
2476
return {}
@@ -2541,6 +2547,10 @@ function! s:GetGrepCommandLine(pattern, add, wholeword, count, escapeArgs)
2541
2547
call s: FilterTargetsWithNoFiles (fileTargetList)
2542
2548
endif
2543
2549
2550
+ if commandParams[" directoryneedsbackslash" ] == 1
2551
+ call map (fileTargetList, ' s:ForwardToBackSlash(v:val)' )
2552
+ endif
2553
+
2544
2554
" Set extra inclusions and exclusions
2545
2555
if s: IsCommandGrep ()
2546
2556
" Specific inclusions are only set in recursive mode
@@ -2557,8 +2567,6 @@ function! s:GetGrepCommandLine(pattern, add, wholeword, count, escapeArgs)
2557
2567
endif
2558
2568
2559
2569
let opts .= " " . join (map (split (filesToExclude, ' ,' ), ' "--exclude=\"".v:val."\""." --exclude-dir=\"".v:val."\""' ), ' ' )
2560
- elseif s: IsCommandFindstr ()
2561
- call map (fileTargetList, ' s:ForwardToBackSlash(v:val)' )
2562
2570
elseif s: IsCommandAck ()
2563
2571
" Patch up the command line in a way that ack understands; do the
2564
2572
" following:
0 commit comments