chore: fix diagnostic warnings/errors
This commit is contained in:
@@ -8,7 +8,7 @@ local function write_template(path, template, values)
|
||||
file:close()
|
||||
end
|
||||
|
||||
function build(name, specs, palette, options)
|
||||
local function build(name, specs, palette, options)
|
||||
local exclude = options.exclude or {}
|
||||
local templates = { "vim", "iterm", "kitty", "alacritty", "wezterm", "lualine", "lightline", "tmux" }
|
||||
for _, t in ipairs(templates) do
|
||||
@@ -218,7 +218,7 @@ local colorschemes = {
|
||||
},
|
||||
}
|
||||
|
||||
function build_from(colorscheme)
|
||||
local function build_from(colorscheme)
|
||||
if colorscheme.setup then
|
||||
colorscheme.setup()
|
||||
end
|
||||
|
||||
@@ -16,10 +16,11 @@ local function generate(p, opt)
|
||||
elseif opt.darkness == "warm" then
|
||||
p1.bg = p.bg_warm
|
||||
elseif opt.darkness ~= nil then
|
||||
local error_msg = "Unknown darkness value: " .. vim.inspect(darkness)
|
||||
local error_msg = "Unknown darkness value: " .. vim.inspect(opt.darkness)
|
||||
vim.notify(error_msg, vim.log.levels.WARN, { title = "zenbones" })
|
||||
end
|
||||
|
||||
---@diagnostic disable: undefined-global
|
||||
-- stylua: ignore start
|
||||
local base = lush(function()
|
||||
return {
|
||||
@@ -255,7 +256,7 @@ local function generate(p, opt)
|
||||
diffIndexLine { fg = p.wood },
|
||||
|
||||
gitcommitOverflow { WarningMsg },
|
||||
|
||||
|
||||
markdownH1 { Statement, gui = "bold,underline" },
|
||||
markdownH2 { Statement },
|
||||
markdownH3 { Statement },
|
||||
@@ -369,6 +370,7 @@ local function generate(p, opt)
|
||||
}
|
||||
end)
|
||||
-- stylua: ignore end
|
||||
---@diagnostic enable: undefined-global
|
||||
|
||||
local specs = {
|
||||
base,
|
||||
@@ -377,11 +379,13 @@ local function generate(p, opt)
|
||||
if opt.lighten_noncurrent_window then
|
||||
table.insert(
|
||||
specs,
|
||||
---@diagnostic disable: undefined-global
|
||||
lush(function()
|
||||
return {
|
||||
NormalNC { base.Normal, bg = base.Normal.bg.li(2) }, -- normal text in non-current windows
|
||||
}
|
||||
end)
|
||||
---@diagnostic enable: undefined-global
|
||||
)
|
||||
end
|
||||
|
||||
@@ -389,6 +393,7 @@ local function generate(p, opt)
|
||||
if not vim.diagnostic then
|
||||
table.insert(
|
||||
specs,
|
||||
---@diagnostic disable: undefined-global
|
||||
lush(function()
|
||||
return {
|
||||
LspDiagnosticsDefaultError { base.DiagnosticError }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
@@ -417,6 +422,7 @@ local function generate(p, opt)
|
||||
-- LspDiagnosticsSignHint { }, -- Used for "Hint" signs in sign column
|
||||
}
|
||||
end)
|
||||
---@diagnostic enable: undefined-global
|
||||
)
|
||||
end
|
||||
-- stylua: ignore end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
function concat_config(prefix, suffixes)
|
||||
local function concat_config(prefix, suffixes)
|
||||
local config = {}
|
||||
for i, suffix in ipairs(suffixes) do
|
||||
config[suffix] = vim.g[prefix .. "_" .. suffix]
|
||||
|
||||
@@ -16,10 +16,11 @@ local function generate(p, opt)
|
||||
elseif opt.lightness == "dim" then
|
||||
p1.bg = p.bg_dim
|
||||
elseif opt.lightness ~= nil then
|
||||
local error_msg = "Unknown lightness value: " .. vim.inspect(lightness)
|
||||
local error_msg = "Unknown lightness value: " .. vim.inspect(opt.lightness)
|
||||
vim.notify(error_msg, vim.log.levels.WARN, { title = "zenbones" })
|
||||
end
|
||||
|
||||
---@diagnostic disable: undefined-global
|
||||
-- stylua: ignore start
|
||||
local base = lush(function()
|
||||
return {
|
||||
@@ -255,7 +256,7 @@ local function generate(p, opt)
|
||||
diffIndexLine { fg = p.wood },
|
||||
|
||||
gitcommitOverflow { WarningMsg },
|
||||
|
||||
|
||||
markdownH1 { Statement, gui = "bold,underline" },
|
||||
markdownH2 { Statement },
|
||||
markdownH3 { Statement },
|
||||
@@ -369,6 +370,7 @@ local function generate(p, opt)
|
||||
}
|
||||
end)
|
||||
-- stylua: ignore end
|
||||
---@diagnostic enable: undefined-global
|
||||
|
||||
local specs = {
|
||||
base,
|
||||
@@ -377,11 +379,13 @@ local function generate(p, opt)
|
||||
if opt.darken_noncurrent_window then
|
||||
table.insert(
|
||||
specs,
|
||||
---@diagnostic disable: undefined-global
|
||||
lush(function()
|
||||
return {
|
||||
NormalNC { base.Normal, bg = base.Normal.bg.da(2) }, -- normal text in non-current windows
|
||||
}
|
||||
end)
|
||||
---@diagnostic enable: undefined-global
|
||||
)
|
||||
end
|
||||
|
||||
@@ -389,6 +393,7 @@ local function generate(p, opt)
|
||||
if not vim.diagnostic then
|
||||
table.insert(
|
||||
specs,
|
||||
---@diagnostic disable: undefined-global
|
||||
lush(function()
|
||||
return {
|
||||
LspDiagnosticsDefaultError { base.DiagnosticError }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
@@ -417,6 +422,7 @@ local function generate(p, opt)
|
||||
-- LspDiagnosticsSignHint { }, -- Used for "Hint" signs in sign column
|
||||
}
|
||||
end)
|
||||
---@diagnostic enable: undefined-global
|
||||
)
|
||||
end
|
||||
-- stylua: ignore end
|
||||
|
||||
@@ -85,5 +85,5 @@ return function(name, specs, p)
|
||||
template = template .. table.concat(vim.fn.sort(xml_compiled), "\n")
|
||||
template = template .. end_template
|
||||
|
||||
return { string.format("extras/iterm/%s.itermcolors", name), template, values }
|
||||
return { string.format("extras/iterm/%s.itermcolors", name), template, {} }
|
||||
end
|
||||
|
||||
@@ -23,7 +23,7 @@ let s:p.tabline.tabsel = [ [ "${tabsel_fg}", "${tabsel_bg}", "bold" ] ]
|
||||
let g:lightline#colorscheme#zenbones#palette = lightline#colorscheme#fill(s:p)
|
||||
]]
|
||||
|
||||
return function(name, specs, p)
|
||||
return function(name, specs)
|
||||
return {
|
||||
string.format("autoload/lightline/colorscheme/%s.vim", name),
|
||||
template,
|
||||
|
||||
@@ -34,7 +34,7 @@ return {
|
||||
}
|
||||
]]
|
||||
|
||||
return function(name, specs, p)
|
||||
return function(name, specs)
|
||||
return {
|
||||
string.format("lua/lualine/themes/%s.lua", name),
|
||||
template,
|
||||
|
||||
@@ -15,10 +15,9 @@ brights = ["${color8}", "${color9}", "${color10}", "${color11}", "${color12}", "
|
||||
|
||||
return function(name, specs, p)
|
||||
local term = require("zenbones.term").colors_map(p)
|
||||
local name = name:sub(1, 1):upper() .. name:sub(2)
|
||||
|
||||
local values = {
|
||||
name = name,
|
||||
name = name:sub(1, 1):upper() .. name:sub(2),
|
||||
fg = specs.Normal.fg.hex,
|
||||
bg = specs.Normal.bg.hex,
|
||||
cursor_bg = specs.Cursor.bg.hex,
|
||||
@@ -31,5 +30,5 @@ return function(name, specs, p)
|
||||
values["color" .. (i - 1)] = v.hex
|
||||
end
|
||||
|
||||
return { string.format("extras/wezterm/%s.toml", name), template, values }
|
||||
return { string.format("extras/wezterm/%s.toml", values.name), template, values }
|
||||
end
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
local lush = require "lush"
|
||||
local generator = require "zenbones.specs"
|
||||
local bg = vim.opt.background:get()
|
||||
local p = require("zenwritten.palette")[bg]
|
||||
|
||||
Reference in New Issue
Block a user