summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gen_themes.zig12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/gen_themes.zig b/tools/gen_themes.zig
index 62aafcf5..79a23a19 100644
--- a/tools/gen_themes.zig
+++ b/tools/gen_themes.zig
@@ -25,7 +25,9 @@
//! acme of its own; the file is otherwise untouched. So are `monokai`,
//! `ayu_dark` and `nord` as `<name>_helix.toml`, kept (unlike helix's other
//! copies of themes ported here) because helix themes inherit them; those
-//! `inherits` lines name the renamed file. Two themes answering to
+//! `inherits` lines name the renamed file. A retired theme a kept one
+//! inherits from (ayu_dark_helix, hex_steel, nord_helix: DESIGN.md E) sits in
+//! vendor/themes/base/, passed as `base=<path>`: read, never rung. Two themes answering to
//! one name is a bug (`Theme <name>` would silently pick one), so core/colors.zig
//! asserts the ring's names are distinct at comptime.
//!
@@ -103,12 +105,16 @@ pub fn main(init: std.process.Init) !void {
// and the parent may be later in argv (or inherit something itself).
var tomls: std.StringHashMapUnmanaged(Toml) = .empty;
var stems: std.ArrayList([]const u8) = .empty;
- for (args[2..]) |src| {
+ for (args[2..]) |arg| {
+ // `base=` a retired theme kept themes inherit from: read, never rung
+ // (vendor/themes/base/)
+ const base = std.mem.startsWith(u8, arg, "base=");
+ const src = if (base) arg["base=".len..] else arg;
const text = try std.Io.Dir.cwd().readFileAlloc(io, src, arena, .limited(8 << 20));
if (std.mem.endsWith(u8, src, ".toml")) {
const stem = std.fs.path.stem(src);
try tomls.put(arena, stem, parseToml(arena, src, text));
- try stems.append(arena, stem);
+ if (!base) try stems.append(arena, stem);
} else if (std.mem.endsWith(u8, src, ".json")) {
try readZed(arena, gpa, src, text, &themes);
} else {