From ff5555e3c854e762ed392f3d3bf13f0da744608d Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 20 Oct 2023 11:34:29 +0300 Subject: [PATCH] statusline/lualine: disable LSP status inside toggleterm buffer --- modules/statusline/lualine/lualine.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/statusline/lualine/lualine.nix b/modules/statusline/lualine/lualine.nix index ab4d05a6..abfd0489 100644 --- a/modules/statusline/lualine/lualine.nix +++ b/modules/statusline/lualine/lualine.nix @@ -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 = ' ',