Move variable declaration outside of for loop

This commit is contained in:
Rane Brown 2019-04-08 22:18:07 -06:00
parent 3bf389bf99
commit 82ba1e99bf

View File

@ -363,14 +363,15 @@ function! vimwiki#diary#generate_diary_section()
" file and multiple H1 headers will be indented by shiftwidth
call add(lines, repeat(' ', vimwiki#lst#get_list_margin()).bullet.entry)
let startindent = repeat(' ', vimwiki#lst#get_list_margin())
let indentstring = repeat(' ', vimwiki#u#sw())
for [depth, subcap] in captions['rest']
if empty(subcap)
continue
endif
let entry = substitute(link_tpl, '__LinkUrl__', fl.'#'.subcap, '')
let entry = substitute(entry, '__LinkDescription__', subcap, '')
let startindent = repeat(' ', vimwiki#lst#get_list_margin())
let indentstring = repeat(' ', vimwiki#u#sw())
" if single H1 then depth H2=0, H3=1, H4=2, H5=3, H6=4
" if multiple H1 then depth H1= 0, H2=1, H3=2, H4=3, H5=4, H6=5
" indent subsequent headers levels by shiftwidth