diff --git a/lua/catppuccin/groups/integrations/feline.lua b/lua/catppuccin/groups/integrations/feline.lua index afbbe351..1a45862f 100644 --- a/lua/catppuccin/groups/integrations/feline.lua +++ b/lua/catppuccin/groups/integrations/feline.lua @@ -139,6 +139,12 @@ function M.get() return false end + -- Check if lazy.nvim is installed + local has_lazy = function() + local lazy_installed, _ = pcall(require, "lazy") + return lazy_installed + end + -- #################### STATUSLINE -> -- ######## Left @@ -287,7 +293,7 @@ function M.get() -- macro components.active[1][12] = { provider = "macro", - enabled = function() return vim.api.nvim_get_option "cmdheight" == 0 end, + enabled = function() return vim.api.nvim_get_option_value("cmdheight", { scope = "global" }) == 0 end, hl = { fg = sett.extras, bg = sett.bkg, @@ -298,7 +304,30 @@ function M.get() -- search count components.active[1][13] = { provider = "search_count", - enabled = function() return vim.api.nvim_get_option "cmdheight" == 0 end, + enabled = function() return vim.api.nvim_get_option_value("cmdheight", { scope = "global" }) == 0 end, + hl = { + fg = sett.extras, + bg = sett.bkg, + }, + left_sep = invi_sep, + } + + -- lazy.nvim updates + components.active[1][14] = { + provider = function() + if has_lazy() then + return require("lazy.status").updates() + else + return " " + end + end, + enabled = function() + if has_lazy() then + return require("lazy.status").has_updates() + else + return false + end + end, hl = { fg = sett.extras, bg = sett.bkg, @@ -412,7 +441,7 @@ function M.get() components.active[3][2] = { provider = function() - local active_clients = vim.lsp.get_active_clients { bufnr = 0 } + local active_clients = vim.lsp.get_clients { bufnr = 0 } -- show an indicator that we have running lsps if view.lsp.name == false and next(active_clients) ~= nil then return assets.lsp.server .. " " .. "Lsp" end