File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ --- @param event OrgTodoChangedEvent
2+ return function (event )
3+ if event .headline :is_done () and not event .was_done and (event .old_todo_state and event .old_todo_state ~= ' ' ) then
4+ event .headline :clock_out ()
5+ end
6+ end
Original file line number Diff line number Diff line change 11local Events = require (' orgmode.events.types' )
22local AlignTags = require (' orgmode.events.listeners.align_tags' )
3+ local ClockOut = require (' orgmode.events.listeners.clock_out' )
34
45return {
56 [Events .TodoChanged ] = {
67 AlignTags ,
8+ ClockOut ,
79 },
810 [Events .HeadlineDemoted ] = {
911 AlignTags ,
Original file line number Diff line number Diff line change @@ -477,10 +477,10 @@ function OrgMappings:_todo_change_state(direction)
477477 local repeat_note_template = (' %s- State %-12s from %-12s [%s]' ):format (
478478 indent ,
479479 [[ "]] .. new_todo .. [[ "]] ,
480- [[ "]] .. old_state .. [[ "]] ,
480+ [[ "]] .. ( old_state or ' ' ) .. [[ "]] ,
481481 Date .now ():to_string ()
482482 )
483- local repeat_note_title = (' Insert note for state change from "%s" to "%s"' ):format (old_state , new_todo )
483+ local repeat_note_title = (' Insert note for state change from "%s" to "%s"' ):format (old_state or ' ' , new_todo )
484484
485485 if log_repeat_enabled then
486486 item :set_property (' LAST_REPEAT' , Date .now ():to_wrapped_string (false ))
You can’t perform that action at this time.
0 commit comments