feat: generate Alacritty files in toml instead of yaml (#158)
Newer versions of Alacritty use the toml format instead of yaml.
This commit is contained in:
@@ -1,11 +1,48 @@
|
||||
local helpers = require("shipwright.transform.helpers")
|
||||
|
||||
local base_template = [[
|
||||
[colors.bright]
|
||||
black = "$bright_black"
|
||||
red = "$bright_red"
|
||||
green = "$bright_green"
|
||||
yellow = "$bright_yellow"
|
||||
blue = "$bright_blue"
|
||||
magenta = "$bright_magenta"
|
||||
cyan = "$bright_cyan"
|
||||
white = "$bright_white"
|
||||
|
||||
[colors.cursor]
|
||||
cursor = "$cursor_bg"
|
||||
text = "$cursor_fg"
|
||||
|
||||
[colors.normal]
|
||||
black = "$black"
|
||||
blue = "$blue"
|
||||
cyan = "$cyan"
|
||||
green = "$green"
|
||||
magenta = "$magenta"
|
||||
red = "$red"
|
||||
white = "$white"
|
||||
yellow = "$yellow"
|
||||
|
||||
[colors.primary]
|
||||
background = "$bg"
|
||||
foreground = "$fg"]]
|
||||
|
||||
local function alacritty_toml(colors)
|
||||
local text = helpers.apply_template(base_template, colors)
|
||||
|
||||
return helpers.split_newlines(text)
|
||||
end
|
||||
|
||||
---@diagnostic disable: undefined-global
|
||||
-- selene: allow(undefined_variable)
|
||||
run(
|
||||
{ specs, p, term },
|
||||
transform.colorscheme_to_term_colors,
|
||||
contrib.alacritty,
|
||||
alacritty_toml,
|
||||
{ prepend, "# This file is auto-generated by shipwright.nvim" },
|
||||
{ overwrite, string.format("extras/alacritty/%s.yml", name) }
|
||||
{ overwrite, string.format("extras/alacritty/%s.toml", name) }
|
||||
)
|
||||
-- selene: deny(undefined_variable)
|
||||
---@diagnostic enable: undefined-global
|
||||
|
||||
Reference in New Issue
Block a user