File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,32 @@ 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+
3349function ! s: require ()
34- if exists (' :AcidRequire' ) && expand (" %r" ) !~ " .*test.*"
50+ let path = expand (" %" )
51+
52+ if exists (" g:acid_alt_test_paths" )
53+ let test_paths = add (g: acid_alt_test_paths , " test" )
54+ else
55+ let test_paths = [" test" ]
56+ endif
57+
58+ if exists (' :AcidRequire' ) && all_true (not_in (path , path_to_pattern (test_paths)))
3559 AcidRequire
3660 endif
3761endfunction
You can’t perform that action at this time.
0 commit comments