diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lv-galaxyline/init.lua | 31 | 
1 files changed, 30 insertions, 1 deletions
| diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index a7821932..6da044c8 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -178,9 +178,38 @@ table.insert(gls.right, {      }  }) +local get_lsp_client = function (msg) +    msg = msg or "No Active LSP Client" +    local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') +    local clients = vim.lsp.get_active_clients() +    if next(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 +                lsps = lsps .. ", " .. client.name +                print("more", lsps) +            end +        end +    end +    if lsps == "" then +        return msg +    else +        return lsps +    end +end + +  table.insert(gls.right, {      ShowLspClient = { -        provider = 'GetLspClient', +        provider = get_lsp_client,          condition = function()              local tbl = {['dashboard'] = true, [' '] = true}              if tbl[vim.bo.filetype] then return false end | 
