Merge pull request #188 from nullchilly/dev

fix: compiler and term colors
dev
Pocco81 2 years ago committed by GitHub
commit cc0d5007fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,8 @@
name: stylua
on:
push:
branches: ["main"]
branches:
- dev
paths-ignore:
- ".github/**"
@ -13,4 +14,4 @@ jobs:
- uses: JohnnyMorganz/stylua-action@1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --check --config-path=.stylua.toml .
args: --check --config-path=stylua.toml .

@ -13,7 +13,7 @@ local function inspect(t)
return fmt([[{ %s }]], table.concat(list, ", "))
end
function util.compile()
function M.compile()
local theme = require("catppuccin.lib.mapper").apply()
local lines = {
[[
@ -27,7 +27,6 @@ end
vim.g.colors_name = "catppuccin"]],
}
local config = require("catppuccin.config").options
local custom_highlights = config.custom_highlights
for property, value in pairs(theme.properties) do
if type(value) == "string" then
table.insert(lines, fmt('vim.o.%s = "%s"', property, value))
@ -37,8 +36,8 @@ vim.g.colors_name = "catppuccin"]],
table.insert(lines, fmt("vim.o.%s = %s", property, inspect(value)))
end
end
local tbl = vim.tbl_deep_extend("keep", theme.integrations, theme.base)
tbl = vim.tbl_deep_extend("keep", custom_highlights, tbl)
local tbl = vim.tbl_deep_extend("keep", theme.integrations, theme.editor)
tbl = vim.tbl_deep_extend("keep", config.custom_highlights, tbl)
for group, color in pairs(tbl) do
if color.link then
@ -100,7 +99,7 @@ vim.g.colors_name = "catppuccin"]],
file:close()
end
function util.clean()
function M.clean()
local config = require("catppuccin.config").options
local compiled_path = config.compile.path
.. (vim.loop.os_uname().sysname == "Windows" and "\\" or "/")
@ -109,3 +108,5 @@ function util.clean()
.. ".lua"
os.remove(compiled_path)
end
return M

@ -24,9 +24,9 @@ function M.syntax(tbl)
end
end
function M.properties(tbl)
function M.properties(tbl, type)
for property, value in pairs(tbl) do
vim.o[property] = value
vim[type][property] = value
end
end
@ -37,14 +37,14 @@ function M.load(theme)
end
g.colors_name = "catppuccin"
M.properties(theme.properties)
M.properties(theme.properties, "o")
M.syntax(theme.editor)
M.syntax(theme.syntax)
M.syntax(theme.integrations)
M.syntax(require("catppuccin.config").options.custom_highlights)
if require("catppuccin.config").options["term_colors"] then
M.properties(theme.terminal)
M.properties(theme.terminal, "g")
end
end

Loading…
Cancel
Save