diff --git a/examples/evil_lualine.lua b/examples/evil_lualine.lua index 1331132b9..80f571b69 100644 --- a/examples/evil_lualine.lua +++ b/examples/evil_lualine.lua @@ -158,19 +158,17 @@ ins_left { ins_left { -- Lsp server name . function() - local msg = 'No Active Lsp' - 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 - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg + local msg = "No Active Lsp" + local clients = vim.lsp.get_clients({ bufnr = 0 }) + + return #clients > 0 + and table.concat( + vim.tbl_map(function(client) + return client.name + end, clients), + "," + ) + or msg end, icon = ' LSP:', color = { fg = '#ffffff', gui = 'bold' },