From 0d5c7d937c7d592ac7f3a9a8253993bffa283288 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 20:34:29 -0300 Subject: core, dev, runtime, test: the settings a session changes while it runs are `config.Settings`, no longer `config.Runtime` (P18, the user's ruling on the tree step's name collisions: the type's name collided with the directory `runtime/`, and the core's field of that type is already `settings`): the type on 17 lines of core/config.zig (its declaration, its methods' receivers, its tests, the comment naming it), `config.Settings` on 50 lines of eleven other files (core/Core.zig, Output.zig, builtins.zig, builtins_json.zig, exec.zig, ninep/ctl.zig, surface.zig; dev/gui/gui.zig 598, 5860, 5909; dev/jump_trail.zig's comment; runtime/main.zig 756; test/output.zig 552) and docs/next-winmode.md's one mention; a rename only, nothing else on any line; the semantics hash does not move (a type's name is not in the tape's shape); tui core-test 848/991 (143 skipped), shell-test 1027/1030, gui unit-test 1625/1629 failing only the perf check's BaselineHarnessMismatch (as the base), the macOS library for Linux and aarch64-macos and the FreeBSD cross-build rc 0, under a load of 6 to 42 Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/exec.zig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'core/exec.zig') diff --git a/core/exec.zig b/core/exec.zig index 687faa98..1ec47eb3 100644 --- a/core/exec.zig +++ b/core/exec.zig @@ -288,7 +288,7 @@ pub fn withArg(p: *Pardes, txt: []const u8, arg: ?[]const u8) []const u8 { // A switch (Verbose, Wrap) clicked with some other text // selected flips, as it does bare: only `on` or `off` is an argument // for it. What a ctl write gives it is checked strictly instead. - if (config.Runtime.find(commandText(t))) |setting| switch (setting.action) { + if (config.Settings.find(commandText(t))) |setting| switch (setting.action) { .toggle => if (!std.mem.eql(u8, a, "on") and !std.mem.eql(u8, a, "off")) return txt, else => {}, }; @@ -688,7 +688,7 @@ pub fn executeFrom(p: *Pardes, id: usize, txt: []const u8, from_body: bool) ?usi // A builtin or setting this build lacks (Fonts on a terminal) is said, // never run as a shell command. const word = cmd[0 .. std.mem.indexOfAny(u8, cmd, " \t") orelse cmd.len]; - if (builtins.absentWhy(word) orelse if (config.Runtime.find(word) != null) @as([]const u8, "GUI-only") else null) |why| { + if (builtins.absentWhy(word) orelse if (config.Settings.find(word) != null) @as([]const u8, "GUI-only") else null) |why| { var said: pardes.Kind.Buf(96) = .{}; p.reportFailure(id, said.print("{s} is {s}, invalid here", .{ word, why })); return null; @@ -937,7 +937,7 @@ fn applyInitText(p: *Pardes, text: []const u8, settings_only: bool) void { // `#` starts a comment only at a line's start: a value may hold one // (`#ff0000`). if (word.len == 0 or isComment(word)) continue; - const setting = config.Runtime.find(word[0 .. std.mem.indexOfAny(u8, word, " \t") orelse word.len]); + const setting = config.Settings.find(word[0 .. std.mem.indexOfAny(u8, word, " \t") orelse word.len]); // Saved in a pane, its settings run again and its commands do not: // a word that is neither (a typo) is still said, as at startup. if (settings_only and setting == null and std.meta.stringToEnum(Builtin, word[0 .. std.mem.indexOfAny(u8, word, " \t+") orelse word.len]) != null) continue; @@ -996,7 +996,7 @@ pub fn runBuiltinFrom(p: *Pardes, b: Builtin, id: usize, txt: []const u8, arg: ? builtins.registry.dispatch(b, c); } -pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[]const u8) void { +pub fn applySettingBuiltin(p: *Pardes, setting: config.Settings.Setting, arg: ?[]const u8) void { const v = p.view(); const previous_tagline_percent = p.settings.font.tagline_percent; switch (setting.action) { @@ -1015,7 +1015,7 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[] }, .font => { if (comptime !font_picker) return; - const spec = config.Runtime.FontSpec.parse(arg orelse return) orelse return; + const spec = config.Settings.FontSpec.parse(arg orelse return) orelse return; // The session's machine's fonts, a question to its disk: a // client's replay takes the session's answer, never its own. const found = pardes.tape.site(.fonts, p.scratch.allocator(), fontNamed, .{ p.scratch.allocator(), spec.name }); @@ -1039,7 +1039,7 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[] var text: pardes.Kind.Buf(340) = .{}; return p.reportFailure(v.active, text.print("Shell: {s}", .{refused})); } - if (!p.settings.apply(p.tape, setting, want, p.sessionHome())) p.reportFailure(v.active, "Shell: takes " ++ comptime config.Runtime.takes(.shell).?); + if (!p.settings.apply(p.tape, setting, want, p.sessionHome())) p.reportFailure(v.active, "Shell: takes " ++ comptime config.Settings.takes(.shell).?); }, // Bare, each says its value, as acme's Tab says the width. inline .tab, .callstack_depth => |_, tag| if (arg == null) { @@ -1047,14 +1047,14 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[] return p.setMessage(.at(v.active), said.print("{s} {d}", .{ setting.word, @field(p.settings, @tagName(tag)) })); } else if (!p.settings.apply(p.tape, setting, arg, p.sessionHome())) { var said: pardes.Kind.Buf(96) = .{}; - p.reportFailure(v.active, said.print("{s}{s}: takes {s}", .{ setting.word, if (tag == .tab) ": invalid tab width" else "", comptime config.Runtime.takes(tag).? })); + p.reportFailure(v.active, said.print("{s}{s}: takes {s}", .{ setting.word, if (tag == .tab) ": invalid tab width" else "", comptime config.Settings.takes(tag).? })); }, // Said with what it takes: its words, its range. else => if (!p.settings.apply(p.tape, setting, arg, p.sessionHome())) { var buf: [160]u8 = undefined; var text: std.Io.Writer = .fixed(&buf); // A list of values too long for the row is cut. - (if (config.Runtime.takes(setting.action)) |values| text.print("{s}: takes {s}", .{ setting.word, values }) else text.print("{s}: does not take that value", .{setting.word})) catch {}; + (if (config.Settings.takes(setting.action)) |values| text.print("{s}: takes {s}", .{ setting.word, values }) else text.print("{s}: does not take that value", .{setting.word})) catch {}; p.reportFailure(v.active, text.buffered()); }, } -- cgit v1.3