Anchor to end of ns string

This commit is contained in:
Neil Kirsopp 2014-01-14 14:02:46 +00:00 committed by Tim Pope
parent b92a9730f0
commit fef85624d3

View File

@ -1177,11 +1177,11 @@ function! fireplace#alternates() abort
let alt = [substitute(ns, '\.test\.', '.', '')] let alt = [substitute(ns, '\.test\.', '.', '')]
elseif ns =~# '-spec$' elseif ns =~# '-spec$'
let alt = [ns[0:-6], ns . '-test'] let alt = [ns[0:-6], ns . '-test']
elseif ns =~# '\.t-\([^\.]\)' elseif ns =~# '\.t-[^\.]*$'
let alt = [substitute(ns, '\.t-\([^\.]\)', '\.\1', '')] let alt = [substitute(ns, '\.t-\([^\.]*\)$', '\.\1', '')]
else else
let alt = [ns . '-test', substitute(ns, '\.', '.test.', ''), ns . '-spec', let alt = [ns . '-test', substitute(ns, '\.', '.test.', ''), ns . '-spec',
\ substitute(ns, '\(.*\)\.\(.*\)', '\1.t-\2', '')] \ substitute(ns, '\.\([^\.]*\)$', '.t-\1', '')]
endif endif
return map(alt, 'tr(v:val, ".-", "/_") . ".clj"') return map(alt, 'tr(v:val, ".-", "/_") . ".clj"')
endfunction endfunction