File tree Expand file tree Collapse file tree 1 file changed +6
-19
lines changed
Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -30,32 +30,19 @@ function! AcidShorthand(callback, shorthand)
3030 exec a: callback s: ret
3131endfunction
3232
33- function ! s: not_in (path , pattern)
34- return a: path !~ a: pattern
35- endfunction
36-
37- function ! s: all_true (pred)
38- for i in a: pred
39- if ! i
40- return 0
41- endif
42- endfor
43- endfunction
44-
45- function ! s: path_to_pattern (paths)
46- return map (a: paths , ' ".*" . v:val . ".*"' )
47- endfunction
48-
4933function ! s: require ()
50- let path = expand (" %" )
51-
5234 if exists (" g:acid_alt_test_paths" )
5335 let test_paths = add (g: acid_alt_test_paths , " test" )
5436 else
5537 let test_paths = [" test" ]
5638 endif
5739
58- if exists (' :AcidRequire' ) && s: all_true (map (s: path_to_pattern (test_paths), function (' s:not_in' , [path ])))
40+ if exists (' :AcidRequire' )
41+ for test_path in test_paths
42+ if expand (" %" ) !~ " .*" .test_path." .*"
43+ return
44+ endfor
45+
5946 AcidRequire
6047 endif
6148endfunction
You can’t perform that action at this time.
0 commit comments