Fix alias edge case detection in cfile

This commit is contained in:
Juho Teperi 2015-09-26 16:57:35 +03:00 committed by Tim Pope
parent 04a7f542f5
commit df563ed15f

View File

@ -1348,11 +1348,16 @@ function! fireplace#cfile() abort
elseif file =~# '^[^/]*/[^/.]*$' && file =~# '^\k\+$' elseif file =~# '^[^/]*/[^/.]*$' && file =~# '^\k\+$'
let [file, jump] = split(file, "/") let [file, jump] = split(file, "/")
if file !~# '\.' if file !~# '\.'
if fireplace#op_available('info')
let res = fireplace#message({'op': 'info', 'symbol': file})
let file = get(get(res, 0, {}), 'ns', file)
else
try try
let file = tr(fireplace#evalparse('((ns-aliases *ns*) '.s:qsym(file).' '.s:qsym(file).')'), '.-', '/_') let file = tr(fireplace#evalparse('((ns-aliases *ns*) '.s:qsym(file).' '.s:qsym(file).')'), '.-', '/_')
catch /^Clojure:/ catch /^Clojure:/
endtry endtry
endif endif
endif
elseif file =~# '^\w[[:alnum:]-]\+\.[[:alnum:].-]\+$' elseif file =~# '^\w[[:alnum:]-]\+\.[[:alnum:].-]\+$'
let file = tr(file, '.-', '/_') let file = tr(file, '.-', '/_')
endif endif