diff options
author | Daniel You <[email protected]> | 2021-07-11 15:12:29 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-11 15:12:29 -0400 |
commit | 1dfad4d233c1d735ffdbf2c19b91539aae4ea01a (patch) | |
tree | fb58b59389bb95712e45a7c4b29e91ac29b72a3f | |
parent | 50bb8acce4fd605bb0687f96143d326366df2701 (diff) |
Prevent duplicate LSP clients from appearing in galaxyline (#880)
* ensure clients are displayed correctly
* prevent duplicate LSPs from showing
-rw-r--r-- | lua/lv-galaxyline/init.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index d7fb9be9..281202a8 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -210,13 +210,15 @@ local get_lsp_client = function(msg) local lsps = "" for _, client in ipairs(clients) do local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= 1 then + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then -- print(client.name) if lsps == "" then -- print("first", lsps) lsps = client.name else - lsps = lsps .. ", " .. client.name + if not string.find(lsps, client.name) then + lsps = lsps .. ", " .. client.name + end -- print("more", lsps) end end |