Skip to content

Commit c654095

Browse files
fix(nightly): Toggle headline checkbox cookie
1 parent 625f060 commit c654095

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lua/orgmode/files/init.lua

+9-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,15 @@ function OrgFiles:get_closest_headline(cursor)
206206
end
207207

208208
function OrgFiles:get_closest_listitem()
209-
local node = ts_utils.closest_node(ts_utils.get_node_at_cursor(), 'listitem')
209+
local get_listitem_node = function()
210+
local node_at_cursor = ts_utils.get_node_at_cursor()
211+
if node_at_cursor and node_at_cursor:type() == 'list' then
212+
return node_at_cursor:named_child(0)
213+
end
214+
return ts_utils.closest_node(node_at_cursor, 'listitem')
215+
end
216+
217+
local node = get_listitem_node()
210218
if node then
211219
return Listitem:new(node, self:get_current_file())
212220
end

0 commit comments

Comments
 (0)