From 81f14864bb98ab251aaa92a973749db971fa721f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 22:59:54 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/exec.zig | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/exec.zig') 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. -- cgit v1.3