parent
b954923cbf
commit
f109e0e488
@ -510,7 +510,13 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{
|
|||||||
let [idx, scheme, path, subdir, lnk, ext, url, anchor] =
|
let [idx, scheme, path, subdir, lnk, ext, url, anchor] =
|
||||||
\ vimwiki#base#resolve_scheme(a:link, 0)
|
\ vimwiki#base#resolve_scheme(a:link, 0)
|
||||||
|
|
||||||
if path == ''
|
" wikilinks of the form [[#anchor]]
|
||||||
|
if url == '' && anchor != ''
|
||||||
|
let lnk = expand('%:t:r')
|
||||||
|
let url = path.subdir.lnk.ext
|
||||||
|
endif
|
||||||
|
|
||||||
|
if url == ''
|
||||||
if g:vimwiki_debug
|
if g:vimwiki_debug
|
||||||
echom 'open_link: idx='.idx.', scheme='.scheme.', path='.path.', subdir='.subdir.', lnk='.lnk.', ext='.ext.', url='.url.', anchor='.anchor
|
echom 'open_link: idx='.idx.', scheme='.scheme.', path='.path.', subdir='.subdir.', lnk='.lnk.', ext='.ext.', url='.url.', anchor='.anchor
|
||||||
endif
|
endif
|
||||||
@ -518,11 +524,6 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if url == ''
|
|
||||||
let lnk = expand('%:t:r')
|
|
||||||
let url = path.subdir.lnk.ext
|
|
||||||
endif
|
|
||||||
|
|
||||||
let update_prev_link = ( (scheme == '' || scheme =~ 'wiki' || scheme =~ 'diary')
|
let update_prev_link = ( (scheme == '' || scheme =~ 'wiki' || scheme =~ 'diary')
|
||||||
\ && lnk != expand('%:t:r')
|
\ && lnk != expand('%:t:r')
|
||||||
\ ? 1 : 0)
|
\ ? 1 : 0)
|
||||||
|
@ -2239,11 +2239,11 @@ similar to 'local:' and 'file:' schemes, but are always opened with Vim: >
|
|||||||
\ ', subdir='.subdir.', lnk='.lnk.', ext='.ext.', url='.url.
|
\ ', subdir='.subdir.', lnk='.lnk.', ext='.ext.', url='.url.
|
||||||
\ ', anchor='.anchor
|
\ ', anchor='.anchor
|
||||||
endif
|
endif
|
||||||
if path == ''
|
if url == '' && anchor == ''
|
||||||
echom 'Vimwiki Error: Unable to resolve link!'
|
echom 'Vimwiki Error: Unable to resolve link!'
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
call vimwiki#base#edit_file('tabnew', url, '', [], 0)
|
call vimwiki#base#edit_file('tabnew', url, anchor, [], 0)
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
Loading…
Reference in New Issue
Block a user