Make VimwikiMakeDiaryNote etc work outside a wiki buffer

Fix #497
This commit is contained in:
EinfachToll 2018-05-23 18:28:03 +02:00
parent 9a8854756e
commit d5c6cee5eb

View File

@ -176,6 +176,9 @@ endfunction
function! vimwiki#diary#make_note(wnum, ...)
if a:wnum == 0
let wiki_nr = vimwiki#vars#get_bufferlocal('wiki_nr')
if wiki_nr < 0 " this happens when e.g. VimwikiMakeDiaryNote was called outside a wiki buffer
let wiki_nr = 0
endif
else
let wiki_nr = a:wnum - 1
endif