summaryrefslogtreecommitdiff
path: root/src/colors.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 19:26:12 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit939c369aee270067d9f030e2b234d93bae549988 (patch)
tree6e3541479cbc228bdd1566f4805496c538ec2f3e /src/colors.zig
parent109a558a0488f3269f1864985e9b3db5f58b9552 (diff)
downloadpardes-939c369aee270067d9f030e2b234d93bae549988.tar.gz
pardes-939c369aee270067d9f030e2b234d93bae549988.zip
After a ThemeFile, the root ctl and DumpConfig say ThemeFile and its path, so what they report writes back
Both said Theme and the name inside the .zon, which no Theme knows, so writing the report back to /ctl failed with "no theme". While a loaded ThemeFile is the theme in effect they now say the word that loaded it. A Dump carries the line too, so a Restore reloads the file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/colors.zig')
-rw-r--r--src/colors.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/colors.zig b/src/colors.zig
index c78043cc..8d541c13 100644
--- a/src/colors.zig
+++ b/src/colors.zig
@@ -735,6 +735,14 @@ pub fn requestThemeFile(p: *Pardes, id: usize, argument: []const u8) void {
p.emit(.{ .theme_file = .{ .generation = generation, .on = true } });
}
+/// The .zon a ThemeFile loaded, while it is the theme in effect: what
+/// /ctl and DumpConfig say in place of `Theme <name>`, since the name
+/// inside the file is no theme `Theme` knows.
+pub fn loadedThemeFile(p: *const Pardes) ?[]const u8 {
+ const path = p.theme_file_path.get();
+ return if (p.custom_theme != null and path.len > 0) path else null;
+}
+
pub const ThemeFileRequest = struct {
path: []const u8,
pane: u8,