Skip to content

Commit

Permalink
feat(feline): allow to hide lazy.nvim updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vollowx authored Jul 10, 2024
1 parent 47bd419 commit 51928b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,8 @@ ctp_feline.setup({
extras = clrs.overlay1,
curr_file = clrs.maroon,
curr_dir = clrs.flamingo,
show_modified = true -- show if the file has been modified
show_modified = false -- show if the file has been modified
show_lazy_updates = true -- show the count of updatable plugins from lazy.nvim
},
mode_colors = {
["n"] = { "NORMAL", clrs.lavender },
Expand Down
3 changes: 2 additions & 1 deletion doc/catppuccin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ Here are the defaults:
extras = clrs.overlay1,
curr_file = clrs.maroon,
curr_dir = clrs.flamingo,
show_modified = true -- show if the file has been modified
show_modified = false -- show if the file has been modified
show_lazy_updates = true -- show the count of updatable plugins from lazy.nvim
},
mode_colors = {
["n"] = { "NORMAL", clrs.lavender },
Expand Down
17 changes: 3 additions & 14 deletions lua/catppuccin/groups/integrations/feline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ local sett = {
curr_file = C.maroon,
curr_dir = C.flamingo,
show_modified = false,
show_lazy_updates = true,
}

if require("catppuccin").flavour == "latte" then
Expand Down Expand Up @@ -139,12 +140,6 @@ 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
Expand Down Expand Up @@ -314,15 +309,9 @@ function M.get()

-- lazy.nvim updates
components.active[1][14] = {
provider = function()
if has_lazy() then
return require("lazy.status").updates()
else
return " "
end
end,
provider = function() return require("lazy.status").updates() end,
enabled = function()
if has_lazy() then
if has_lazy() and sett.show_lazy_updates then
return require("lazy.status").has_updates()
else
return false
Expand Down

0 comments on commit 51928b1

Please sign in to comment.