From 1dfad4d233c1d735ffdbf2c19b91539aae4ea01a Mon Sep 17 00:00:00 2001 From: Daniel You <39450656+youdaniel@users.noreply.github.com> Date: Sun, 11 Jul 2021 15:12:29 -0400 Subject: Prevent duplicate LSP clients from appearing in galaxyline (#880) * ensure clients are displayed correctly * prevent duplicate LSPs from showing --- lua/lv-galaxyline/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lua') 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 -- cgit v1.2.3