Nicer error message when linking to not registered wiki
This commit is contained in:
parent
e6d0678b54
commit
76f51f1dba
@ -174,6 +174,7 @@ function! vimwiki#base#resolve_link(link_text, ...)
|
|||||||
if link_infos.scheme =~# '\mwiki\d\+'
|
if link_infos.scheme =~# '\mwiki\d\+'
|
||||||
let link_infos.index = eval(matchstr(link_infos.scheme, '\D\+\zs\d\+\ze'))
|
let link_infos.index = eval(matchstr(link_infos.scheme, '\D\+\zs\d\+\ze'))
|
||||||
if link_infos.index < 0 || link_infos.index >= vimwiki#vars#number_of_wikis()
|
if link_infos.index < 0 || link_infos.index >= vimwiki#vars#number_of_wikis()
|
||||||
|
let link_infos.index = -1
|
||||||
let link_infos.filename = ''
|
let link_infos.filename = ''
|
||||||
return link_infos
|
return link_infos
|
||||||
endif
|
endif
|
||||||
@ -268,7 +269,11 @@ function! vimwiki#base#open_link(cmd, link, ...)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if link_infos.filename == ''
|
if link_infos.filename == ''
|
||||||
|
if link_infos.index == -1
|
||||||
|
echomsg 'Vimwiki Error: No registered wiki ''' . link_infos.scheme . '''.'
|
||||||
|
else
|
||||||
echomsg 'Vimwiki Error: Unable to resolve link!'
|
echomsg 'Vimwiki Error: Unable to resolve link!'
|
||||||
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user