Bladeren bron

Prevent duplicate LSP clients from appearing in galaxyline (#880)

* ensure clients are displayed correctly

* prevent duplicate LSPs from showing
Daniel You 4 jaren geleden
bovenliggende
commit
1dfad4d233
1 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  1. 4 2
      lua/lv-galaxyline/init.lua

+ 4 - 2
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