Skip to content

Commit bf8f9c9

Browse files
committed
Check org_toggle_archive for note/time config
1 parent af8d6ec commit bf8f9c9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lua/orgmode/org/mappings.lua

+16
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,27 @@ function OrgMappings:_todo_change_state(direction)
419419
section_config = nil
420420
end
421421

422+
-- @type nil | false | 'time' | 'note'
423+
local user_config
424+
if config.org_todo_keywords ~= nil then
425+
local todoConfig = TodoConfig:parse(table.concat(config.org_todo_keywords, ' '))
426+
if todoConfig ~= nil then
427+
user_config = todoConfig:get_logging_behavior(old_state, new_state)
428+
else
429+
-- TODO: Report invalid config?
430+
user_config = nil
431+
end
432+
else
433+
user_config = nil
434+
end
435+
422436
-- Use the most locally available log config
423437
--- @type false | 'time' | 'note'
424438
local log_config
425439
if section_config ~= nil then
426440
log_config = section_config
441+
elseif user_config ~= nil then
442+
log_config = user_config
427443
else
428444
log_config = global_config
429445
end

0 commit comments

Comments
 (0)