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,10 +1348,15 @@ 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 !~# '\.'
try if fireplace#op_available('info')
let file = tr(fireplace#evalparse('((ns-aliases *ns*) '.s:qsym(file).' '.s:qsym(file).')'), '.-', '/_') let res = fireplace#message({'op': 'info', 'symbol': file})
catch /^Clojure:/ let file = get(get(res, 0, {}), 'ns', file)
endtry else
try
let file = tr(fireplace#evalparse('((ns-aliases *ns*) '.s:qsym(file).' '.s:qsym(file).')'), '.-', '/_')
catch /^Clojure:/
endtry
endif
endif endif
elseif file =~# '^\w[[:alnum:]-]\+\.[[:alnum:].-]\+$' elseif file =~# '^\w[[:alnum:]-]\+\.[[:alnum:].-]\+$'
let file = tr(file, '.-', '/_') let file = tr(file, '.-', '/_')