diff options
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 18 |
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| { |
