Skip to content

Commit 6599ee5

Browse files
committed
Parameterizer with directoryneedsbackslash
1 parent eac41bf commit 6599ee5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

plugin/EasyGrep.vim

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,6 +2395,7 @@ function! s:GetGrepCommandParameters()
23952395
\ 'bufferdirsearchallowed': '1',
23962396
\ 'backslashdir': '0',
23972397
\ 'errorsuppress': '',
2398+
\ 'directoryneedsbackslash': '0',
23982399
\ }
23992400
elseif s:IsCommandGrep()
24002401
return {
@@ -2409,6 +2410,7 @@ function! s:GetGrepCommandParameters()
24092410
\ 'bufferdirsearchallowed': '!recursive',
24102411
\ 'backslashdir': '0',
24112412
\ 'errorsuppress': '-s',
2413+
\ 'directoryneedsbackslash': '0',
24122414
\ }
24132415
elseif s:IsCommandGitGrep()
24142416
return {
@@ -2423,6 +2425,7 @@ function! s:GetGrepCommandParameters()
24232425
\ 'bufferdirsearchallowed': '0',
24242426
\ 'backslashdir': '0',
24252427
\ 'errorsuppress': '',
2428+
\ 'directoryneedsbackslash': '0',
24262429
\ }
24272430
elseif s:IsCommandAck()
24282431
return {
@@ -2437,6 +2440,7 @@ function! s:GetGrepCommandParameters()
24372440
\ 'bufferdirsearchallowed': '1',
24382441
\ 'backslashdir': '0',
24392442
\ 'errorsuppress': '',
2443+
\ 'directoryneedsbackslash': '0',
24402444
\ }
24412445
elseif s:IsCommandPt()
24422446
return {
@@ -2451,6 +2455,7 @@ function! s:GetGrepCommandParameters()
24512455
\ 'bufferdirsearchallowed': '1',
24522456
\ 'backslashdir': '0',
24532457
\ 'errorsuppress': '',
2458+
\ 'directoryneedsbackslash': '0',
24542459
\ }
24552460
elseif s:IsCommandFindstr()
24562461
return {
@@ -2465,6 +2470,7 @@ function! s:GetGrepCommandParameters()
24652470
\ 'bufferdirsearchallowed': '1',
24662471
\ 'backslashdir': '1',
24672472
\ 'errorsuppress': '',
2473+
\ 'directoryneedsbackslash': '1',
24682474
\ }
24692475
endif
24702476
return {}
@@ -2541,6 +2547,10 @@ function! s:GetGrepCommandLine(pattern, add, wholeword, count, escapeArgs)
25412547
call s:FilterTargetsWithNoFiles(fileTargetList)
25422548
endif
25432549

2550+
if commandParams["directoryneedsbackslash"] == 1
2551+
call map(fileTargetList, 's:ForwardToBackSlash(v:val)')
2552+
endif
2553+
25442554
" Set extra inclusions and exclusions
25452555
if s:IsCommandGrep()
25462556
" Specific inclusions are only set in recursive mode
@@ -2557,8 +2567,6 @@ function! s:GetGrepCommandLine(pattern, add, wholeword, count, escapeArgs)
25572567
endif
25582568

25592569
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)')
25622570
elseif s:IsCommandAck()
25632571
" Patch up the command line in a way that ack understands; do the
25642572
" following:

0 commit comments

Comments
 (0)