diff options
| author | christianchiarulli <[email protected]> | 2021-07-27 23:35:31 -0400 | 
|---|---|---|
| committer | christianchiarulli <[email protected]> | 2021-07-27 23:35:31 -0400 | 
| commit | 6a9f2eff54907c9e0c7976e2eb33eafd1d8f3ada (patch) | |
| tree | bda4b3e9a36cfb2b777b985c9e0c8fd5482260a0 /lua/core | |
| parent | 2f1fe2fcfda1c96fcfa53bcc7648d6d209b59502 (diff) | |
| parent | c07b0c47317f2ae63682204a772d5ce15cb67aac (diff) | |
Merge branch 'rolling' of github.com:ChristianChiarulli/LunarVim into rolling
Diffstat (limited to 'lua/core')
| -rw-r--r-- | lua/core/galaxyline.lua | 37 | 
1 files changed, 13 insertions, 24 deletions
| diff --git a/lua/core/galaxyline.lua b/lua/core/galaxyline.lua index abc7c369..1cc855ee 100644 --- a/lua/core/galaxyline.lua +++ b/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 | 
