mirror of
https://github.com/neovim/neovim.git
synced 2025-11-09 20:15:24 +00:00
feat(lsp): sort codelens if multiple item per line (#18951)
This commit is contained in:
@@ -133,6 +133,9 @@ function M.display(lenses, bufnr, client_id)
|
|||||||
api.nvim_buf_clear_namespace(bufnr, ns, i, i + 1)
|
api.nvim_buf_clear_namespace(bufnr, ns, i, i + 1)
|
||||||
local chunks = {}
|
local chunks = {}
|
||||||
local num_line_lenses = #line_lenses
|
local num_line_lenses = #line_lenses
|
||||||
|
table.sort(line_lenses, function(a, b)
|
||||||
|
return a.range.start.character < b.range.start.character
|
||||||
|
end)
|
||||||
for j, lens in ipairs(line_lenses) do
|
for j, lens in ipairs(line_lenses) do
|
||||||
local text = lens.command and lens.command.title or 'Unresolved lens ...'
|
local text = lens.command and lens.command.title or 'Unresolved lens ...'
|
||||||
table.insert(chunks, { text, 'LspCodeLens' })
|
table.insert(chunks, { text, 'LspCodeLens' })
|
||||||
|
|||||||
Reference in New Issue
Block a user