summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-31 19:02:04 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:08 -0300
commit005178177a1ddb2eb2f1af5fad36e2717758ee8e (patch)
tree6e974c12def02fd855446d84db25232c1f3b4fd2 /src/pardes.zig
parent41847fce244fdd0d01971c302b89d1252f6497ed (diff)
downloadpardes-005178177a1ddb2eb2f1af5fad36e2717758ee8e.tar.gz
pardes-005178177a1ddb2eb2f1af5fad36e2717758ee8e.zip
the gui wears any monospace font on the machine
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index eb2c8402..760a452f 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -6292,16 +6292,24 @@ pub const Pardes = struct {
defer p.exec_depth -= 1;
// The builtins that take an ARGUMENT match their name with a TAIL:
// `Restore <path>`, `Find <pat>`, `Grep <pat>`, `Rename <name>`,
- // `WsSymbols <sym>`, `Theme <name>`, and the two verbs themselves —
- // `Look <word>`, `Exec <cmd>`, which is what makes `` @`Look .` `` nest
- // (the tail goes straight back through here). Every other name must
- // match WHOLE, so `Kill foo` is a shell command and not Kill.
+ // `WsSymbols <sym>`, `Theme <name>`, `Font <name>` (gui only), and the
+ // two verbs themselves — `Look <word>`, `Exec <cmd>`, which is what
+ // makes `` @`Look .` `` nest (the tail goes straight back through
+ // here). Every other name must match WHOLE, so `Kill foo` is a shell
+ // command and not Kill.
const sp = std.mem.indexOfAny(u8, cmd, " \t");
const bi: ?Builtin = std.meta.stringToEnum(Builtin, cmd) orelse blk: {
const head = std.meta.stringToEnum(Builtin, cmd[0 .. sp orelse break :blk null]) orelse break :blk null;
break :blk switch (head) {
.Restore, .Find, .Grep, .Rename, .WsSymbols, .Theme, .Look, .Exec => head,
- else => null,
+ // Font is a BRANCH and not another name in that prong for the
+ // reason output_pane.traits has the same shape: it is not in
+ // the enum at all off the gui, and a comptime-false `if` is
+ // the one form that is not analysed there.
+ else => {
+ if (platform == .gui) if (head == .Font) break :blk head;
+ break :blk null;
+ },
};
};
if (bi) |b| {