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
1 changed files with 3 additions and 3 deletions

View File

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