Skip to content

Commit e0670aa

Browse files
Fix compatibility issues for log into drawer
1 parent 7a55f61 commit e0670aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/orgmode/treesitter/headline.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,15 +477,15 @@ end
477477

478478
function Headline:get_drawer(name)
479479
local section = self.headline:parent()
480-
local body = section:field('body')
480+
local body = section:field('body')[1]
481481
if not body then
482482
return nil
483483
end
484484

485-
for node, node_name in body[1]:iter_children() do
485+
for _, node in ipairs(ts_utils.get_named_children(body)) do
486486
if node:type() == 'drawer' then
487487
local drawer_name = node:field('name')
488-
if #drawer_name and string.lower(query.get_node_text(drawer_name[1], 0)) == string.lower(name) then
488+
if #drawer_name and string.lower(ts.get_node_text(drawer_name[1], 0)) == string.lower(name) then
489489
return node
490490
end
491491
end

0 commit comments

Comments
 (0)