diff options
author | Squibid <me@zacharyscheiman.com> | 2024-03-09 00:21:19 -0500 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2024-03-09 00:21:19 -0500 |
commit | 805df629dc7fa1a352adc8b7897cf3e1842d5d26 (patch) | |
tree | 7d08958dd66c995fa5c557ab9f66081d02180270 /lua/core/statusbar/components.lua | |
parent | af28d9b7c4566c5e0230f9753baf204693ca9788 (diff) | |
download | nvim-805df629dc7fa1a352adc8b7897cf3e1842d5d26.tar.gz nvim-805df629dc7fa1a352adc8b7897cf3e1842d5d26.tar.bz2 nvim-805df629dc7fa1a352adc8b7897cf3e1842d5d26.zip |
get lsp server name more consistently for the statusbar
Diffstat (limited to '')
-rw-r--r-- | lua/core/statusbar/components.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lua/core/statusbar/components.lua b/lua/core/statusbar/components.lua index cce3127..f731688 100644 --- a/lua/core/statusbar/components.lua +++ b/lua/core/statusbar/components.lua @@ -239,15 +239,11 @@ end function M.lsp_srvname(opts) local fmt = opts.fmt or "%s" local icon = opts.icon or "" - local buf_clients = vim.lsp.buf_get_clients(0) - if not buf_clients or #buf_clients == 0 then - return "" - end local names = "" - for i, c in ipairs(buf_clients) do - if i > 1 then names = names .. ", " end - names = names .. c.name - end + vim.lsp.for_each_buffer_client(0, function(client) + if names ~= "" then names = names..", " end + names = names..client.name + end) return icon..fmt:format(names) end |