mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 11:18:26 +00:00
fix(picker.lsp): sort document symbols by position
This commit is contained in:
parent
1eaeafe1a9
commit
cc22177dcf
1 changed files with 6 additions and 0 deletions
|
@ -375,6 +375,12 @@ function M.symbols(opts, ctx)
|
||||||
return want(M.symbol_kind(item.kind))
|
return want(M.symbol_kind(item.kind))
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
table.sort(items, function(a, b)
|
||||||
|
if a.pos[1] == b.pos[1] then
|
||||||
|
return a.pos[2] < b.pos[2]
|
||||||
|
end
|
||||||
|
return a.pos[1] < b.pos[1]
|
||||||
|
end)
|
||||||
for _, item in ipairs(items) do
|
for _, item in ipairs(items) do
|
||||||
item.tree = opts.tree
|
item.tree = opts.tree
|
||||||
item.buf = bufmap[item.file]
|
item.buf = bufmap[item.file]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue