Browse Source

Merge branch 'rolling' of github.com:ChristianChiarulli/LunarVim into rolling

christianchiarulli 4 years ago
parent
commit
6a9f2eff54
2 changed files with 14 additions and 25 deletions
  1. 1 1
      README.md
  2. 13 24
      lua/core/galaxyline.lua

+ 1 - 1
README.md

@@ -34,7 +34,7 @@ The following command installs LunarVim.  Change `LVBRANCH` to the branch you'd
 LVBRANCH=rolling bash <(curl -s https://raw.githubusercontent.com/ChristianChiarulli/lunarvim/rolling/utils/installer/install.sh)
 ```
 
-### BREAKING CHANGE on the rolling branch
+### BREAKING CHANGE on rolling and master branches
 * The latest changes to LunarVim require you to [remove it completely](https://github.com/ChristianChiarulli/LunarVim/wiki/Uninstalling-LunarVim) before upgrading
 * Going forward LunarVim will no longer reside in the nvim configuration folder.  LunarVim has been moved to `~/.local/share/lunarvim`.  
 * To launch Lunarvim use the new `lvim` command.  `nvim` will only launch standard neovim.  

+ 13 - 24
lua/core/galaxyline.lua

@@ -200,39 +200,28 @@ table.insert(gls.right, {
   },
 })
 
-local get_lsp_client = function(msg)
+local function get_attached_provider_name(msg)
   msg = msg or "LSP Inactive"
-  local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
-  local clients = vim.lsp.get_active_clients()
-  if next(clients) == nil then
+
+  local buf_ft = vim.bo.filetype
+  local buf_clients = vim.lsp.buf_get_clients()
+  if next(buf_clients) == nil then
     return msg
   end
-  local lsps = ""
-  for _, client in ipairs(clients) do
-    local filetypes = client.config.filetypes
-    if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
-      -- print(client.name)
-      if lsps == "" then
-        -- print("first", lsps)
-        lsps = client.name
-      else
-        if not string.find(lsps, client.name) then
-          lsps = lsps .. ", " .. client.name
-        end
-        -- print("more", lsps)
-      end
+  local buf_client_names = {}
+  for _, client in pairs(buf_clients) do
+    if client.name == "null-ls" then
+      table.insert(buf_client_names, lvim.lang[buf_ft].linters[1])
+    else
+      table.insert(buf_client_names, client.name)
     end
   end
-  if lsps == "" then
-    return msg
-  else
-    return lsps
-  end
+  return table.concat(buf_client_names, ", ")
 end
 
 table.insert(gls.right, {
   ShowLspClient = {
-    provider = get_lsp_client,
+    provider = get_attached_provider_name,
     condition = function()
       local tbl = { ["dashboard"] = true, [" "] = true }
       if tbl[vim.bo.filetype] then