statusline/lualine: disable LSP status inside toggleterm buffer

This commit is contained in:
raf 2023-10-20 11:34:29 +03:00
parent 897493a65f
commit ff5555e3c8
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29

View file

@ -185,19 +185,29 @@ in {
{
{
-- Lsp server name .
function()
local msg = 'No Active Lsp'
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
-- Check if the current buffer type is "toggleterm"
if buf_ft == "toggleterm" then
return ""
end
local msg = 'No Active Lsp'
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
end,
icon = ' ',