@@ -261,7 +261,7 @@ function! s:IsRecursiveSearch()
261
261
return ! s: IsModeBuffers ()
262
262
endif
263
263
let commandParams = s: GetGrepCommandParameters ()
264
- return has_key (commandParams, " isinherentlyrecursive" ) && (commandParams[" isinherentlyrecursive" ] == 1 )
264
+ return has_key (commandParams, " isinherentlyrecursive" ) && (commandParams[" isinherentlyrecursive" ] == ' 1 ' )
265
265
endfunction
266
266
" }}}
267
267
" GetSavedName {{{
@@ -1021,7 +1021,8 @@ function! s:ActivateChoice(choice)
1021
1021
let selectedMode = s: EasyGrepModeMultipleChoice
1022
1022
endif
1023
1023
1024
- if s: IsCommandAck ()
1024
+ let commandParams = s: GetGrepCommandParameters ()
1025
+ if s: CommandHas (" isselffiltering" )
1025
1026
if selectedMode != s: EasyGrepModeAll && selectedMode != s: EasyGrepModeBuffers
1026
1027
call s: Error (" Cannot activate '" .s: GetModeName (selectedMode)." ' mode when " .s: GetGrepProgramVarAndName ()." , as this grepprg implements its own filtering" )
1027
1028
return
@@ -1919,10 +1920,10 @@ endfunction
1919
1920
" CheckGrepCommandForChanges {{{
1920
1921
function ! s: CheckGrepCommandForChanges ()
1921
1922
if &grepprg != s: LastSeenGrepprg
1922
- if s: IsCommandAck ( )
1923
+ if s: CommandHas ( " isselffiltering " )
1923
1924
if ! s: IsModeAll () && ! s: IsModeBuffers ()
1924
1925
call s: Info (" ==================================================================================" )
1925
- call s: Info (" The 'grepprg' has changed to '" .s: GetGrepCommandName ()." ' since last inspected" )
1926
+ call s: Info (" The 'grepprg' has changed to '" .s: GetGrepProgramName ()." ' since last inspected" )
1926
1927
call s: Info (" Switching to 'All' mode as the '" .s: GetModeName (g: EasyGrepMode )." ' mode is incompatible with this program" )
1927
1928
call s: Info (" ==================================================================================" )
1928
1929
call s: ForceGrepMode (s: EasyGrepModeAll )
@@ -2381,6 +2382,17 @@ function! s:IsCommandFindstr()
2381
2382
return ! s: IsCommandVimgrep () && (s: GetGrepProgramName () == " findstr" )
2382
2383
endfunction
2383
2384
" }}}
2385
+ " CommandParameterMatches {{{
2386
+ function ! s: CommandParameterMatches (parameter, value)
2387
+ let commandParams = s: GetGrepCommandParameters ()
2388
+ return has_key (commandParams, a: parameter ) && (commandParams[a: parameter ] == a: value )
2389
+ endfunction
2390
+ " }}}
2391
+ " CommandHas {{{
2392
+ function ! s: CommandHas (parameter)
2393
+ return s: CommandParameterMatches (a: parameter , ' 1' )
2394
+ endfunction
2395
+ " }}}
2384
2396
" GetGrepCommandParameters {{{
2385
2397
function ! s: GetGrepCommandParameters ()
2386
2398
@@ -2401,6 +2413,7 @@ function! s:GetGrepCommandParameters()
2401
2413
\ ' errorsuppress' : ' ' ,
2402
2414
\ ' directoryneedsbackslash' : ' 0' ,
2403
2415
\ ' isinherentlyrecursive' : ' 0' ,
2416
+ \ ' isselffiltering' : ' 0' ,
2404
2417
\ }
2405
2418
elseif s: IsCommandGrep ()
2406
2419
return {
@@ -2419,6 +2432,7 @@ function! s:GetGrepCommandParameters()
2419
2432
\ ' errorsuppress' : ' -s' ,
2420
2433
\ ' directoryneedsbackslash' : ' 0' ,
2421
2434
\ ' isinherentlyrecursive' : ' 0' ,
2435
+ \ ' isselffiltering' : ' 0' ,
2422
2436
\ }
2423
2437
elseif s: IsCommandGitGrep ()
2424
2438
return {
@@ -2437,6 +2451,7 @@ function! s:GetGrepCommandParameters()
2437
2451
\ ' errorsuppress' : ' ' ,
2438
2452
\ ' directoryneedsbackslash' : ' 0' ,
2439
2453
\ ' isinherentlyrecursive' : ' 0' ,
2454
+ \ ' isselffiltering' : ' 0' ,
2440
2455
\ }
2441
2456
elseif s: IsCommandAck ()
2442
2457
return {
@@ -2455,6 +2470,7 @@ function! s:GetGrepCommandParameters()
2455
2470
\ ' errorsuppress' : ' ' ,
2456
2471
\ ' directoryneedsbackslash' : ' 0' ,
2457
2472
\ ' isinherentlyrecursive' : ' 1' ,
2473
+ \ ' isselffiltering' : ' 1' ,
2458
2474
\ }
2459
2475
elseif s: IsCommandPt ()
2460
2476
return {
@@ -2473,6 +2489,7 @@ function! s:GetGrepCommandParameters()
2473
2489
\ ' errorsuppress' : ' ' ,
2474
2490
\ ' directoryneedsbackslash' : ' 0' ,
2475
2491
\ ' isinherentlyrecursive' : ' 0' ,
2492
+ \ ' isselffiltering' : ' 0' ,
2476
2493
\ }
2477
2494
elseif s: IsCommandFindstr ()
2478
2495
return {
@@ -2491,6 +2508,7 @@ function! s:GetGrepCommandParameters()
2491
2508
\ ' errorsuppress' : ' ' ,
2492
2509
\ ' directoryneedsbackslash' : ' 1' ,
2493
2510
\ ' isinherentlyrecursive' : ' 0' ,
2511
+ \ ' isselffiltering' : ' 0' ,
2494
2512
\ }
2495
2513
endif
2496
2514
return {}
0 commit comments