diff --git a/lua/cosmic/utils.lua b/lua/cosmic/utils.lua index 648d978..60c1914 100644 --- a/lua/cosmic/utils.lua +++ b/lua/cosmic/utils.lua @@ -43,11 +43,13 @@ function M.get_active_lsp_client_names() 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) + table.insert(client_names, client.name) end end - table.sort(client_names) + if not vim.tbl_isempty(client_names) then + table.sort(client_names) + end return client_names end @@ -70,6 +72,7 @@ end function M.reload_cosmic() unload('cosmic') require('cosmic') + vim.cmd(':e') end function M.get_install_dir()