We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 625f060 commit c654095Copy full SHA for c654095
lua/orgmode/files/init.lua
@@ -206,7 +206,15 @@ function OrgFiles:get_closest_headline(cursor)
206
end
207
208
function OrgFiles:get_closest_listitem()
209
- local node = ts_utils.closest_node(ts_utils.get_node_at_cursor(), 'listitem')
+ 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
216
+
217
+ local node = get_listitem_node()
218
if node then
219
return Listitem:new(node, self:get_current_file())
220
0 commit comments