Skip to content

Commit 54ffa49

Browse files
committed
Check org_toggle_archive for note/time config
1 parent 7a93ffe commit 54ffa49

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: lua/orgmode/org/mappings.lua

+16
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,27 @@ function OrgMappings:_todo_change_state(direction)
428428
section_config = nil
429429
end
430430

431+
-- @type nil | false | 'time' | 'note'
432+
local user_config
433+
if config.org_todo_keywords ~= nil then
434+
local todoConfig = TodoConfig:parse(table.concat(config.org_todo_keywords, ' '))
435+
if todoConfig ~= nil then
436+
user_config = todoConfig:get_logging_behavior(old_state, new_state)
437+
else
438+
-- TODO: Report invalid config?
439+
user_config = nil
440+
end
441+
else
442+
user_config = nil
443+
end
444+
431445
-- Use the most locally available log config
432446
--- @type false | 'time' | 'note'
433447
local log_config
434448
if section_config ~= nil then
435449
log_config = section_config
450+
elseif user_config ~= nil then
451+
log_config = user_config
436452
else
437453
log_config = global_config
438454
end

0 commit comments

Comments
 (0)