mirror of
https://github.com/taigrr/glaze.nvim.git
synced 2026-04-02 03:09:10 -07:00
large update
This commit is contained in:
@@ -152,7 +152,7 @@ function M.check(opts)
|
||||
local remaining = 0
|
||||
local updates_found = 0
|
||||
|
||||
for name, binary in pairs(binaries) do
|
||||
for name, _ in pairs(binaries) do
|
||||
remaining = remaining + 2 -- installed version + latest version
|
||||
|
||||
local info = {
|
||||
@@ -216,7 +216,10 @@ function M.check(opts)
|
||||
elseif not opts.silent then
|
||||
if updates_found > 0 then
|
||||
vim.schedule(function()
|
||||
vim.notify("Glaze: " .. updates_found .. " update(s) available — run :GlazeUpdate", vim.log.levels.INFO)
|
||||
vim.notify(
|
||||
"Glaze: " .. updates_found .. " update(s) available — run :GlazeUpdate",
|
||||
vim.log.levels.INFO
|
||||
)
|
||||
end)
|
||||
else
|
||||
vim.schedule(function()
|
||||
|
||||
@@ -1,50 +1,110 @@
|
||||
---@brief [[
|
||||
--- glaze.nvim color definitions
|
||||
--- Charmbracelet-inspired palette with Lazy.nvim structure
|
||||
--- Doughnut-inspired palette with Lazy.nvim structure
|
||||
--- When use_system_theming is enabled, uses standard nvim highlight groups instead
|
||||
---@brief ]]
|
||||
|
||||
local M = {}
|
||||
|
||||
-- Charmbracelet-inspired colors (pink/magenta theme)
|
||||
-- Doughnut-inspired palette
|
||||
local palette = {
|
||||
frosting = "#FF6AD5", -- Primary pink accent
|
||||
lavender = "#C4A7E7", -- Soft purple
|
||||
mint = "#9FFFCB", -- Success green
|
||||
honey = "#FFD866", -- Warning yellow
|
||||
coral = "#FF6B6B", -- Error red
|
||||
sky = "#7DCFFF", -- URL blue
|
||||
grape = "#BB9AF7", -- Plugin purple
|
||||
ash = "#6E6A86", -- Muted gray
|
||||
shadow = "#3B3A52", -- Dark purple-gray
|
||||
ink = "#1A1B26", -- Background dark
|
||||
}
|
||||
|
||||
-- Doughnut-inspired colors (pink/magenta theme)
|
||||
M.colors = {
|
||||
-- Headers and accents
|
||||
H1 = { fg = "#FF6AD5", bold = true }, -- Charm pink
|
||||
H2 = { fg = "#C4A7E7", bold = true }, -- Soft purple
|
||||
Title = { fg = "#FF6AD5", bold = true },
|
||||
H1 = { fg = palette.frosting, bold = true },
|
||||
H2 = { fg = palette.lavender, bold = true },
|
||||
Title = { fg = palette.frosting, bold = true },
|
||||
|
||||
-- Status indicators
|
||||
Done = { fg = "#9FFFCB" }, -- Mint green (success)
|
||||
Running = { fg = "#FFD866" }, -- Warm yellow (in progress)
|
||||
Pending = { fg = "#6E6A86" }, -- Muted gray
|
||||
Error = { fg = "#FF6B6B", bold = true }, -- Soft red
|
||||
Done = { fg = palette.mint },
|
||||
Running = { fg = palette.honey },
|
||||
Pending = { fg = palette.ash },
|
||||
Error = { fg = palette.coral, bold = true },
|
||||
|
||||
-- Content
|
||||
Normal = "NormalFloat",
|
||||
Binary = { fg = "#FF6AD5" }, -- Charm pink for binary names
|
||||
Url = { fg = "#7DCFFF", italic = true }, -- Bright blue for URLs
|
||||
Plugin = { fg = "#BB9AF7" }, -- Purple for plugin names
|
||||
Binary = { fg = palette.frosting },
|
||||
Url = { fg = palette.sky, italic = true },
|
||||
Plugin = { fg = palette.grape },
|
||||
Comment = "Comment",
|
||||
Dimmed = "Conceal",
|
||||
|
||||
-- Progress bar
|
||||
ProgressDone = { fg = "#FF6AD5" }, -- Charm pink
|
||||
ProgressTodo = { fg = "#3B3A52" }, -- Dark purple-gray
|
||||
ProgressDone = { fg = palette.frosting },
|
||||
ProgressTodo = { fg = palette.shadow },
|
||||
|
||||
-- UI elements
|
||||
Border = { fg = "#FF6AD5" },
|
||||
Border = { fg = palette.frosting },
|
||||
Button = "CursorLine",
|
||||
ButtonActive = { bg = "#FF6AD5", fg = "#1A1B26", bold = true },
|
||||
Key = { fg = "#FFD866", bold = true }, -- Keybind highlights
|
||||
ButtonActive = { bg = palette.frosting, fg = palette.ink, bold = true },
|
||||
Key = { fg = palette.honey, bold = true },
|
||||
|
||||
-- Version info
|
||||
Version = { fg = "#9FFFCB" },
|
||||
Time = { fg = "#6E6A86", italic = true },
|
||||
Version = { fg = palette.mint },
|
||||
Time = { fg = palette.ash, italic = true },
|
||||
|
||||
-- Icons
|
||||
Icon = { fg = "#FF6AD5" },
|
||||
IconDone = { fg = "#9FFFCB" },
|
||||
IconError = { fg = "#FF6B6B" },
|
||||
IconRunning = { fg = "#FFD866" },
|
||||
Icon = { fg = palette.frosting },
|
||||
IconDone = { fg = palette.mint },
|
||||
IconError = { fg = palette.coral },
|
||||
IconRunning = { fg = palette.honey },
|
||||
|
||||
Bold = { bold = true },
|
||||
Italic = { italic = true },
|
||||
}
|
||||
|
||||
-- System theme colors (links to standard nvim groups)
|
||||
M.system_colors = {
|
||||
-- Headers and accents
|
||||
H1 = "Title",
|
||||
H2 = "Title",
|
||||
Title = "Title",
|
||||
|
||||
-- Status indicators
|
||||
Done = "DiagnosticOk",
|
||||
Running = "DiagnosticWarn",
|
||||
Pending = "Comment",
|
||||
Error = "DiagnosticError",
|
||||
|
||||
-- Content
|
||||
Normal = "NormalFloat",
|
||||
Binary = "Identifier",
|
||||
Url = "Underlined",
|
||||
Plugin = "Special",
|
||||
Comment = "Comment",
|
||||
Dimmed = "Conceal",
|
||||
|
||||
-- Progress bar
|
||||
ProgressDone = "DiagnosticOk",
|
||||
ProgressTodo = "Comment",
|
||||
|
||||
-- UI elements
|
||||
Border = "FloatBorder",
|
||||
Button = "CursorLine",
|
||||
ButtonActive = "PmenuSel",
|
||||
Key = "SpecialKey",
|
||||
|
||||
-- Version info
|
||||
Version = "DiagnosticOk",
|
||||
Time = "Comment",
|
||||
|
||||
-- Icons
|
||||
Icon = "Special",
|
||||
IconDone = "DiagnosticOk",
|
||||
IconError = "DiagnosticError",
|
||||
IconRunning = "DiagnosticWarn",
|
||||
|
||||
Bold = { bold = true },
|
||||
Italic = { italic = true },
|
||||
@@ -53,7 +113,10 @@ M.colors = {
|
||||
M.did_setup = false
|
||||
|
||||
function M.set_hl()
|
||||
for name, def in pairs(M.colors) do
|
||||
local glaze = require("glaze")
|
||||
local colors = glaze.config.ui.use_system_theming and M.system_colors or M.colors
|
||||
|
||||
for name, def in pairs(colors) do
|
||||
local hl = type(def) == "table" and def or { link = def }
|
||||
hl.default = true
|
||||
vim.api.nvim_set_hl(0, "Glaze" .. name, hl)
|
||||
|
||||
@@ -54,7 +54,7 @@ function M.check()
|
||||
vim.health.ok("GOBIN in PATH: " .. gobin)
|
||||
else
|
||||
vim.health.warn("GOBIN exists but is not in PATH: " .. gobin, {
|
||||
"Add to PATH: export PATH=\"" .. gobin .. ":$PATH\"",
|
||||
'Add to PATH: export PATH="' .. gobin .. ':$PATH"',
|
||||
"Binaries installed by Glaze may not be found without this",
|
||||
})
|
||||
end
|
||||
|
||||
@@ -19,35 +19,36 @@ local M = {}
|
||||
---@field callback? fun(success: boolean) Optional callback after install/update
|
||||
|
||||
---@class GlazeAutoCheckConfig
|
||||
---@field enabled boolean Whether to auto-check for updates
|
||||
---@field frequency string|number Frequency: "daily", "weekly", or hours as number
|
||||
---@field enabled? boolean Whether to auto-check for updates
|
||||
---@field frequency? string|number Frequency: "daily", "weekly", or hours as number
|
||||
|
||||
---@class GlazeAutoInstallConfig
|
||||
---@field enabled boolean Whether to auto-install missing binaries on register
|
||||
---@field silent boolean Suppress notifications during auto-install
|
||||
---@field enabled? boolean Whether to auto-install missing binaries on register
|
||||
---@field silent? boolean Suppress notifications during auto-install
|
||||
|
||||
---@class GlazeAutoUpdateConfig
|
||||
---@field enabled boolean Whether to auto-update binaries when newer versions are found (requires auto_check)
|
||||
---@field enabled? boolean Whether to auto-update binaries when newer versions are found (requires auto_check)
|
||||
|
||||
---@class GlazeConfig
|
||||
---@field ui GlazeUIConfig
|
||||
---@field concurrency number Max parallel installations
|
||||
---@field go_cmd string[] Go command (supports goenv)
|
||||
---@field auto_install GlazeAutoInstallConfig
|
||||
---@field auto_check GlazeAutoCheckConfig
|
||||
---@field auto_update GlazeAutoUpdateConfig
|
||||
---@field ui? GlazeUIConfig
|
||||
---@field concurrency? number Max parallel installations
|
||||
---@field go_cmd? string[] Go command (supports goenv)
|
||||
---@field auto_install? GlazeAutoInstallConfig
|
||||
---@field auto_check? GlazeAutoCheckConfig
|
||||
---@field auto_update? GlazeAutoUpdateConfig
|
||||
|
||||
---@class GlazeUIConfig
|
||||
---@field border string Border style
|
||||
---@field size { width: number, height: number }
|
||||
---@field icons GlazeIcons
|
||||
---@field border? string Border style
|
||||
---@field size? { width: number, height: number }
|
||||
---@field icons? GlazeIcons
|
||||
---@field use_system_theming? boolean Use nvim highlight groups instead of doughnut colors
|
||||
|
||||
---@class GlazeIcons
|
||||
---@field pending string
|
||||
---@field running string
|
||||
---@field done string
|
||||
---@field error string
|
||||
---@field binary string
|
||||
---@field pending? string
|
||||
---@field running? string
|
||||
---@field done? string
|
||||
---@field error? string
|
||||
---@field binary? string
|
||||
|
||||
---@type GlazeConfig
|
||||
M.config = {
|
||||
@@ -61,6 +62,7 @@ M.config = {
|
||||
error = "✗",
|
||||
binary = "",
|
||||
},
|
||||
use_system_theming = false,
|
||||
},
|
||||
concurrency = 4,
|
||||
go_cmd = { "go" },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---@brief [[
|
||||
--- glaze.nvim view/UI
|
||||
--- Lazy.nvim-style floating window with Charmbracelet aesthetic
|
||||
--- Lazy.nvim-style floating window with doughnut aesthetic
|
||||
---@brief ]]
|
||||
|
||||
local M = {}
|
||||
@@ -32,13 +32,16 @@ function M._get_cursor_binary()
|
||||
end
|
||||
|
||||
---Open the Glaze UI.
|
||||
---If already open, just re-render without recreating the window.
|
||||
function M.open()
|
||||
local Float = require("glaze.float").Float
|
||||
|
||||
-- If window is already open and valid, just render and return
|
||||
if M._float and M._float:valid() then
|
||||
M._float:close()
|
||||
M.render()
|
||||
return
|
||||
end
|
||||
|
||||
local Float = require("glaze.float").Float
|
||||
|
||||
M._float = Float.new({
|
||||
title = " 🍩 Glaze ",
|
||||
})
|
||||
@@ -190,17 +193,16 @@ function M.render()
|
||||
local binaries = glaze.binaries()
|
||||
local binary_count = vim.tbl_count(binaries)
|
||||
|
||||
-- Count updates available
|
||||
-- Count updates available (only binaries with has_update = true)
|
||||
local updates_available = 0
|
||||
local update_info = checker.get_update_info()
|
||||
for _ in pairs(update_info) do
|
||||
updates_available = updates_available + 1
|
||||
for _, info in pairs(update_info) do
|
||||
if info.has_update then
|
||||
updates_available = updates_available + 1
|
||||
end
|
||||
end
|
||||
|
||||
local header_suffix = " (" .. binary_count .. ")"
|
||||
if updates_available > 0 then
|
||||
header_suffix = header_suffix
|
||||
end
|
||||
text:append("Binaries", "GlazeH2"):append(header_suffix, "GlazeComment")
|
||||
if updates_available > 0 then
|
||||
text:append(" " .. updates_available .. " update(s) available", "GlazeRunning")
|
||||
|
||||
Reference in New Issue
Block a user