Skip to content

Commit

Permalink
Check org_toggle_archive for note/time config
Browse files Browse the repository at this point in the history
  • Loading branch information
chuck-flowers committed Jun 27, 2023
1 parent 33ebc72 commit 9e52d2f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lua/orgmode/org/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,27 @@ function OrgMappings:_todo_change_state(direction)
section_config = nil
end

-- @type nil | false | 'time' | 'note'
local user_config
if config.org_todo_keywords ~= nil then
local todoConfig = TodoConfig:parse(table.concat(config.org_todo_keywords, ' '))
if todoConfig ~= nil then
user_config = todoConfig:get_logging_behavior(old_state, new_state)
else
-- TODO: Report invalid config?
user_config = nil
end
else
user_config = nil
end

-- Use the most locally available log config
--- @type false | 'time' | 'note'
local log_config
if section_config ~= nil then
log_config = section_config
elseif user_config ~= nil then
log_config = user_config
else
log_config = global_config
end
Expand Down

0 comments on commit 9e52d2f

Please sign in to comment.