Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update evil_lualine.lua #1290

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions examples/evil_lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
Loading