We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a55f61 commit e0670aaCopy full SHA for e0670aa
lua/orgmode/treesitter/headline.lua
@@ -477,15 +477,15 @@ end
477
478
function Headline:get_drawer(name)
479
local section = self.headline:parent()
480
- local body = section:field('body')
+ local body = section:field('body')[1]
481
if not body then
482
return nil
483
end
484
485
- for node, node_name in body[1]:iter_children() do
+ for _, node in ipairs(ts_utils.get_named_children(body)) do
486
if node:type() == 'drawer' then
487
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
+ if #drawer_name and string.lower(ts.get_node_text(drawer_name[1], 0)) == string.lower(name) then
489
return node
490
491
0 commit comments