Fix checkboxes not getting updated in some cases

This commit is contained in:
EinfachToll 2013-07-29 10:36:43 +02:00
parent 911f2d4a8c
commit 6317912520

View File

@ -461,9 +461,8 @@ endfunction "}}}
"Returns: the (rounded) rate of [X] checked child items in percent "Returns: the (rounded) rate of [X] checked child items in percent
function! s:get_rate(item) "{{{ function! s:get_rate(item) "{{{
let rate = -1
if a:item.type == 0 || a:item.cb == '' if a:item.type == 0 || a:item.cb == ''
return rate return -1
endif endif
let state = a:item.cb let state = a:item.cb
return index(g:vimwiki_listsyms, state) * 25 return index(g:vimwiki_listsyms, state) * 25
@ -1060,9 +1059,8 @@ function! s:change_level(from_line, to_line, direction, plus_children) "{{{
endif endif
call s:update_state(old_parent) call s:update_state(old_parent)
let from_item = s:get_item(from_item.lnum) let from_item = s:get_item(from_item.lnum)
if s:get_rate(from_item) < 100 if from_item.cb != ''
call s:update_state(from_item) call s:update_state(from_item)
else
call s:update_state(s:get_parent(from_item)) call s:update_state(s:get_parent(from_item))
endif endif