From 0bfa4615988c0d1bcaa38453375760c60076c5ea Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 31 Jul 2026 02:21:01 -0300 Subject: themes: one file each, generated from helix and zed, picked by stepping a list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each theme is a .zig file of pure data and nothing enumerates them by hand — fold() walks the container's declarations, so a theme is a file and that is the whole registration. Field by field rather than a wholesale coercion, which makes a missing field a compile error that names it. tools/gen_themes.zig reads helix .toml and zed .json out of vendor/themes and emits one .zig each; build.zig reads that directory, so adding a theme is dropping a file in. Output goes to the build cache rather than the tree, so zig owns the freshness check and a deleted source cannot leave a stale theme behind. Vendored, not read from the genizah: the build stays offline. A source it cannot map is a hard error naming the file and the key, never a silently black-on-black theme. ThemeSel is the clever half. Traits gained an `executes` column, so n/N over that buffer hands the whole line to Exec instead of the leading word to Look — both arms the ordinary builtin, so a stepped row does exactly what the matching mouse button on it would. Stepping the list previews each theme live. The trait is a pane property, not an output-pane branch, so any pane whose lines are commands can opt in. Goldens: leader gains SPC t t; theme's fourth NextColor no longer wraps to helix because the ring is fifteen long. New: themesel. --- src/config.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/config.zig') diff --git a/src/config.zig b/src/config.zig index c4249270..35be4b9f 100644 --- a/src/config.zig +++ b/src/config.zig @@ -108,6 +108,11 @@ pub const leader_path = std.EnumArray(Builtin, ?[]const u8).init(.{ .Colors = "tc", .NextColor = "tn", .Crt = "tr", + // the theme picker joins the toggles it belongs with; `Theme` itself takes + // a NAME, and a key path can never carry one, so it has none (the same + // reason Look and Exec have none) + .ThemeSel = "tt", + .Theme = null, // the image toggles join the same `t` group; Palette takes `l` because // `p` is Petscii's and `c` is Colors'. .Petscii = "tp", @@ -401,6 +406,7 @@ pub const symbol_marker = " WsSymbols /"; pub const search_buffer = "+Search"; pub const help_buffer = "+Help"; pub const jumps_buffer = "+Jumps"; +pub const themes_buffer = "+Themes"; pub const hover_buffer = "+Hover"; pub const lsp_buffer = "+Lsp"; -- cgit v1.3