diff options
author | christianchiarulli <[email protected]> | 2021-07-03 16:34:43 -0400 |
---|---|---|
committer | christianchiarulli <[email protected]> | 2021-07-03 16:34:43 -0400 |
commit | 8f37e7f2784b56d918f64960fd7b5c02947904f4 (patch) | |
tree | 779334acd01341786e81f00140a18bd91403b168 /lua/lv-galaxyline/init.lua | |
parent | 703fdfd48d966c8a74085e9d77816fa76070b65a (diff) | |
parent | 80bda1932308dcaac74958ef771a9c060446f093 (diff) |
Merge branch 'master' of github.com:ChristianChiarulli/LunarVim into stable
Diffstat (limited to 'lua/lv-galaxyline/init.lua')
-rw-r--r-- | lua/lv-galaxyline/init.lua | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/lua/lv-galaxyline/init.lua b/lua/lv-galaxyline/init.lua index a7821932..51b9072c 100644 --- a/lua/lv-galaxyline/init.lua +++ b/lua/lv-galaxyline/init.lua @@ -103,7 +103,7 @@ table.insert(gls.left, { highlight = {colors.red, colors.bg} } }) -print(vim.fn.getbufvar(0, 'ts')) +-- print(vim.fn.getbufvar(0, 'ts')) vim.fn.getbufvar(0, 'ts') table.insert(gls.left, { @@ -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 |