File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,8 @@ endfunction
170170function ! VimTodoListsMoveSubtree (lineno, position)
171171 let l: subtree_length = VimTodoListsFindLastChild (a: lineno ) - a: lineno + 1
172172 let l: cursor_pos = getcurpos ()
173+ call cursor (a: lineno , l: cursor_pos [4 ])
174+ let l: cursor_pos = getcurpos ()
173175
174176 " Copy subtree to the required position
175177 execute ' normal! ' . l: subtree_length . ' Y'
@@ -282,10 +284,14 @@ function! VimTodoListsForEachChild(lineno, function)
282284 return
283285 endif
284286
285- for current_line in range (a: lineno , l: last_child_lineno )
287+ " Apply the function on children prior to the item.
288+ " This order is required for proper work of the items moving on toggle
289+ for current_line in range (a: lineno + 1 , l: last_child_lineno )
286290 call call (a: function , [current_line])
287291 endfor
288292
293+ call call (a: function , [a: lineno ])
294+
289295endfunction
290296
291297
You can’t perform that action at this time.
0 commit comments