Update argument handling in diary#make_note

Fix an "Undefined variable: a:3" error that occurs when attempting to open
a diary page with Calendar.vim.
This commit is contained in:
Keith Haber 2017-11-14 22:57:52 -08:00 committed by Michael F. Schönitzer
parent 164b760d3b
commit c94af4b3f1

View File

@ -174,16 +174,15 @@ function! vimwiki#diary#make_note(wnum, ...) "{{{
call vimwiki#path#mkdir(VimwikiGet('path', idx).VimwikiGet('diary_rel_path', idx)) call vimwiki#path#mkdir(VimwikiGet('path', idx).VimwikiGet('diary_rel_path', idx))
let cmd = 'edit'
if a:0 if a:0
if a:1 == 1 if a:1 == 1
let cmd = 'tabedit' let cmd = 'tabedit'
elseif a:2 == 2 elseif a:1 == 2
let cmd = 'split' let cmd = 'split'
elseif a:3 == 3 elseif a:1 == 3
let cmd = 'vsplit' let cmd = 'vsplit'
endif endif
else
let cmd = 'edit'
endif endif
if a:0>1 if a:0>1
let link = 'diary:'.a:2 let link = 'diary:'.a:2