Skip to content

Commit 955acfc

Browse files
fix(#666): Read plan dates without name
1 parent e04cb32 commit 955acfc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/orgmode/files/headline.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,11 @@ function Headline:get_plan_dates()
563563
return dates, dates_nodes
564564
end
565565

566-
local valid_plan_types = { 'SCHEDULED', 'DEADLINE', 'CLOSED' }
566+
local valid_plan_types = { 'SCHEDULED', 'DEADLINE', 'CLOSED', 'NONE' }
567567

568568
for _, node in ipairs(ts_utils.get_named_children(plan)) do
569-
local name = self.file:get_node_text(node:field('name')[1])
569+
local name_node = node:field('name')[1]
570+
local name = name_node and self.file:get_node_text(name_node) or 'NONE'
570571
local timestamp = node:field('timestamp')[1]
571572

572573
if vim.tbl_contains(valid_plan_types, name:upper()) then

0 commit comments

Comments
 (0)