Tweak <cfile>
This commit is contained in:
parent
cb3c270c99
commit
1f478e401a
@ -1340,17 +1340,17 @@ function! fireplace#cfile() abort
|
|||||||
let file = expand('<cfile>')
|
let file = expand('<cfile>')
|
||||||
if file =~# '^\w[[:alnum:]_/]*$' &&
|
if file =~# '^\w[[:alnum:]_/]*$' &&
|
||||||
\ synIDattr(synID(line("."),col("."),1),"name") =~# 'String'
|
\ synIDattr(synID(line("."),col("."),1),"name") =~# 'String'
|
||||||
let file = substitute(expand('%:p'), '[^\/:]*$', '', '').a:file.'.'.expand('%:e')
|
let file = substitute(expand('%:p'), '[^\/:]*$', '', '').a:file
|
||||||
elseif file =~# '^[^/]*/[^/.]*$' && file =~# '^\k\+$'
|
elseif file =~# '^[^/]*/[^/.]*$' && file =~# '^\k\+$'
|
||||||
let [file, jump] = split(file, "/")
|
let [file, jump] = split(file, "/")
|
||||||
if file !~# '\.'
|
if file !~# '\.'
|
||||||
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
|
||||||
elseif file =~# '^\w[[:alnum:]-]\+\.[[:alnum:].-]\+$'
|
elseif file =~# '^\w[[:alnum:]-]\+\.[[:alnum:].-]\+$'
|
||||||
let file = tr(file, '.', '/')
|
let file = tr(file, '.-', '/_')
|
||||||
endif
|
endif
|
||||||
if exists('jump')
|
if exists('jump')
|
||||||
return '+sil!dj\ ' . jump . ' ' . fnameescape(file)
|
return '+sil!dj\ ' . jump . ' ' . fnameescape(file)
|
||||||
|
Loading…
Reference in New Issue
Block a user