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 1
1
local Events = require (' orgmode.events.types' )
2
2
local AlignTags = require (' orgmode.events.listeners.align_tags' )
3
+ local ClockOut = require (' orgmode.events.listeners.clock_out' )
3
4
4
5
return {
5
6
[Events .TodoChanged ] = {
6
7
AlignTags ,
8
+ ClockOut ,
7
9
},
8
10
[Events .HeadlineDemoted ] = {
9
11
AlignTags ,
Original file line number Diff line number Diff line change @@ -477,10 +477,10 @@ function OrgMappings:_todo_change_state(direction)
477
477
local repeat_note_template = (' %s- State %-12s from %-12s [%s]' ):format (
478
478
indent ,
479
479
[[ "]] .. new_todo .. [[ "]] ,
480
- [[ "]] .. old_state .. [[ "]] ,
480
+ [[ "]] .. ( old_state or ' ' ) .. [[ "]] ,
481
481
Date .now ():to_string ()
482
482
)
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 )
484
484
485
485
if log_repeat_enabled then
486
486
item :set_property (' LAST_REPEAT' , Date .now ():to_wrapped_string (false ))
You can’t perform that action at this time.
0 commit comments