fix(statusline): fix lsp active clients
This commit is contained in:
parent
ff3a7a5de4
commit
7fc6a26751
1 changed files with 6 additions and 2 deletions
|
@ -39,8 +39,12 @@ end
|
||||||
function M.get_active_lsp_client_names()
|
function M.get_active_lsp_client_names()
|
||||||
local active_clients = vim.lsp.get_active_clients()
|
local active_clients = vim.lsp.get_active_clients()
|
||||||
local client_names = {}
|
local client_names = {}
|
||||||
for i, client in pairs(active_clients) do
|
for i, client in pairs(active_clients or {}) do
|
||||||
table.insert(client_names, i, client.name)
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
|
-- only return attached buffers
|
||||||
|
if vim.lsp.buf_is_attached(buf, client.id) then
|
||||||
|
table.insert(client_names, i, client.name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
table.sort(client_names)
|
table.sort(client_names)
|
||||||
|
|
Loading…
Add table
Reference in a new issue