@@ -476,14 +476,9 @@ function OrgMappings:_todo_change_state(direction)
476476 -- Reset to first TODO of the same sequence for repeating tasks
477477 local todos = item .file :get_todo_keywords ()
478478 local todo_state = TodoState :new ({ current_state = new_todo , todos = todos })
479- local reset_keyword = todo_state :get_reset_todo (item )
479+ local reset_keyword = todo_state :get_reset_todo (item , old_state )
480480
481- if reset_keyword then
482- item :set_todo (reset_keyword .value )
483- else
484- self :_change_todo_state (' reset' )
485- new_todo = item :get_todo ()
486- end
481+ item :set_todo (reset_keyword .value )
487482
488483 local prompt_repeat_note = config .org_log_repeat == ' note'
489484 local log_repeat_enabled = config .org_log_repeat ~= false
@@ -1066,14 +1061,6 @@ function OrgMappings:_change_todo_state(direction, use_fast_access)
10661061
10671062 local todos = headline .file :get_todo_keywords ()
10681063
1069- -- Store the sequence index of the original keyword, if any
1070- local original_sequence_index = nil
1071- local current_keyword_obj = todos :find (current_keyword )
1072-
1073- if current_keyword_obj then
1074- original_sequence_index = current_keyword_obj .sequence_index
1075- end
1076-
10771064 local todo_state = TodoState :new ({ current_state = current_keyword , todos = todos })
10781065 local next_state = nil
10791066
@@ -1084,8 +1071,6 @@ function OrgMappings:_change_todo_state(direction, use_fast_access)
10841071 next_state = todo_state :get_next ()
10851072 elseif direction == ' prev' then
10861073 next_state = todo_state :get_prev ()
1087- elseif direction == ' reset' then
1088- next_state = todo_state :get_reset_todo (headline )
10891074 end
10901075 end
10911076
0 commit comments