summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 12:23:15 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitd191193a1e707a6bfd8fc8bbe1429dbc9f34676f (patch)
tree083b64ec90e82566c60a7a72bac957e79d2ae4e5 /src/exec.zig
parentc06a666ca4daf0068372e825807007f7bbcf5523 (diff)
downloadpardes-d191193a1e707a6bfd8fc8bbe1429dbc9f34676f.tar.gz
pardes-d191193a1e707a6bfd8fc8bbe1429dbc9f34676f.zip
A Theme hint drops whole names to fit, never cutting one mid-word
The names were written into a fixed room until it ran out, the last one cut, and the click's form ran past the 128 bytes a 9P error carries. Each name now goes in whole or not at all, and both forms are sized to fit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/exec.zig b/src/exec.zig
index cf4e01ab..88c0705d 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -918,9 +918,13 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[]
// A config line is not answered on screen (applyStartupConfig
// runs with announce off); a click or a ctl write is.
if (!p.announce) return;
- var near: [170]u8 = undefined;
+ // All of it within the 128 bytes a 9P error carries, so a write
+ // failing with it is cut nowhere: the names get what is left.
+ const shown = want[0..@min(want.len, 40)];
+ const room = 128 -| ("Theme: no theme \"\"; like it: ; Themes lists all".len + shown.len);
+ var near: [128]u8 = undefined;
var text: [256]u8 = undefined;
- return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Theme: no theme \"{s}\"; like it: {s}; Themes lists all", .{ want[0..@min(want.len, 40)], colors.themesNear(&near, want) }) catch "Theme: no such theme");
+ return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Theme: no theme \"{s}\"; like it: {s}; Themes lists all", .{ shown, colors.themesNear(near[0..@min(room, near.len)], want) }) catch "Theme: no such theme");
},
.font => {
if (comptime !font_picker) return;