mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(picker.lsp): only sort when not getting workspace symbols. Closes #1071
This commit is contained in:
parent
6e0962a82e
commit
d607d2e050
1 changed files with 8 additions and 6 deletions
|
@ -356,12 +356,14 @@ function M.symbols(opts, ctx)
|
|||
})
|
||||
|
||||
-- Fix sorting
|
||||
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)
|
||||
if not opts.workspace then
|
||||
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)
|
||||
end
|
||||
|
||||
-- fix last
|
||||
local last = {} ---@type table<snacks.picker.finder.Item, snacks.picker.finder.Item>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue