Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lua/aerial/snacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ M.pick_symbol = function(opts)
local bufdata = data.get_or_create(bufnr)
---@type snacks.picker.finder.Item[]
local items = {}
---@type table<snacks.picker.finder.Item, snacks.picker.finder.Item>
local last = {}
for i, item in bufdata:iter({ skip_hidden = false }) do
local snack_item = {
idx = i,
Expand All @@ -36,7 +38,13 @@ M.pick_symbol = function(opts)
end_pos = { item.end_lnum, item.end_col },
}
if item.parent then
snack_item.parent = items[item.parent.idx]
local parent = items[item.parent.idx]
snack_item.parent = parent
if last[parent] then
last[parent].last = nil
end
last[parent] = snack_item
snack_item.last = true
end
table.insert(items, snack_item)
end
Expand Down