diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 22:59:54 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-04 22:59:54 -0300 |
| commit | 81f14864bb98ab251aaa92a973749db971fa721f (patch) | |
| tree | f1bbe4180aefec26790c51379af00a398b16650b | |
| parent | e57b26fc1406a2f1e6541558d5ebd35d7ef54b1d (diff) | |
| download | pardes-81f14864bb98ab251aaa92a973749db971fa721f.tar.gz pardes-81f14864bb98ab251aaa92a973749db971fa721f.zip | |
exec: Tab, CallstackDepth and SearchRows say their value bare from one inline prong, where each had its own copy; the refusals read as before, Tab's invalid tab width included
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
| -rw-r--r-- | src/exec.zig | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/exec.zig b/src/exec.zig index a1894b7f..3fc03038 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -1119,25 +1119,14 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[] } if (!p.settings.apply(setting, want)) p.reportFailure(p.active, "Shell: takes " ++ comptime config.Runtime.takes(.shell).?); }, - .callstack_depth => if (arg == null) { + // Bare, each says its value, as acme's Tab says the width. + inline .tab, .callstack_depth, .search_rows => |_, tag| if (arg == null) { var said: [40]u8 = undefined; - return p.setMessage(p.active, std.fmt.bufPrint(&said, "CallstackDepth {d}", .{p.settings.callstack_depth}) catch "CallstackDepth"); + return p.setMessage(p.active, std.fmt.bufPrint(&said, "{s} {d}", .{ setting.word, @field(p.settings, @tagName(tag)) }) catch setting.word); } else if (!p.settings.apply(setting, arg)) { - p.reportFailure(p.active, "CallstackDepth: takes " ++ comptime config.Runtime.takes(.callstack_depth).?); - }, - .search_rows => if (arg == null) { - var said: [40]u8 = undefined; - return p.setMessage(p.active, std.fmt.bufPrint(&said, "SearchRows {d}", .{p.settings.search_rows}) catch "SearchRows"); - } else if (!p.settings.apply(setting, arg)) { - p.reportFailure(p.active, "SearchRows: takes " ++ comptime config.Runtime.takes(.search_rows).?); - }, - // Bare, it says the width, as acme's Tab does. - .tab => if (arg == null) { - var said: [32]u8 = undefined; - return p.setMessage(p.active, std.fmt.bufPrint(&said, "Tab {d}", .{p.settings.tab}) catch "Tab"); - } else if (!p.settings.apply(setting, arg)) { - p.reportFailure(p.active, "Tab: invalid tab width: takes " ++ comptime config.Runtime.takes(.tab).?); - } else { + var said: [96]u8 = undefined; + p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}{s}: takes {s}", .{ setting.word, if (tag == .tab) ": invalid tab width" else "", comptime config.Runtime.takes(tag).? }) catch setting.word); + } else if (tag == .tab) { config.tab_now = p.settings.tab; }, // Said with what it takes: its words, its range. |
