parent
b954923cbf
commit
f109e0e488
@ -510,7 +510,13 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{
|
||||
let [idx, scheme, path, subdir, lnk, ext, url, anchor] =
|
||||
\ 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
|
||||
echom 'open_link: idx='.idx.', scheme='.scheme.', path='.path.', subdir='.subdir.', lnk='.lnk.', ext='.ext.', url='.url.', anchor='.anchor
|
||||
endif
|
||||
@ -518,11 +524,6 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{
|
||||
return
|
||||
endif
|
||||
|
||||
if url == ''
|
||||
let lnk = expand('%:t:r')
|
||||
let url = path.subdir.lnk.ext
|
||||
endif
|
||||
|
||||
let update_prev_link = ( (scheme == '' || scheme =~ 'wiki' || scheme =~ 'diary')
|
||||
\ && lnk != expand('%:t:r')
|
||||
\ ? 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.
|
||||
\ ', anchor='.anchor
|
||||
endif
|
||||
if path == ''
|
||||
if url == '' && anchor == ''
|
||||
echom 'Vimwiki Error: Unable to resolve link!'
|
||||
return 0
|
||||
else
|
||||
call vimwiki#base#edit_file('tabnew', url, '', [], 0)
|
||||
call vimwiki#base#edit_file('tabnew', url, anchor, [], 0)
|
||||
return 1
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
Loading…
Reference in New Issue
Block a user