summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/Addon.zig2
-rw-r--r--core/CHANGELOG.md4
-rw-r--r--core/Core.zig18
-rw-r--r--core/Dir.zig2
-rw-r--r--core/Effect.zig2
-rw-r--r--core/Handover.zig4
-rw-r--r--core/Output.zig8
-rw-r--r--core/Query.zig16
-rw-r--r--core/builtins.zig28
-rw-r--r--core/builtins_json.zig4
-rw-r--r--core/config.zig36
-rw-r--r--core/dump.zig12
-rw-r--r--core/edit_cmd.zig2
-rw-r--r--core/exec.zig16
-rw-r--r--core/fs.zig2
-rw-r--r--core/keys.zig2
-rw-r--r--core/layout.zig22
-rw-r--r--core/look.zig4
-rw-r--r--core/mouse.zig2
-rw-r--r--core/ninep/addr.zig2
-rw-r--r--core/ninep/cols.zig2
-rw-r--r--core/ninep/ctl.zig28
-rw-r--r--core/ninep/events.zig2
-rw-r--r--core/ninep/harness.zig (renamed from core/ninep/testing.zig)0
-rw-r--r--core/ninep/pane.zig2
-rw-r--r--core/ninep/pty.zig2
-rw-r--r--core/ninep/screen.zig2
-rw-r--r--core/ninep/sources.zig2
-rw-r--r--core/ninep/tree.zig2
-rw-r--r--core/panes.zig4
-rw-r--r--core/sam_edit.zig2
-rw-r--r--core/surface.zig2
-rw-r--r--core/tagline.zig4
-rw-r--r--core/tape.zig2
-rw-r--r--core/views.zig4
35 files changed, 126 insertions, 122 deletions
diff --git a/core/Addon.zig b/core/Addon.zig
index ec2f796a..0b60ca9c 100644
--- a/core/Addon.zig
+++ b/core/Addon.zig
@@ -911,7 +911,7 @@ test "addon reload gives migration the old record version and saves the new vers
return if (version == 1 and n == 1 and bytes[0] == 7) Kind.c.PA_OK else 1;
}
};
- const p = try @import("ninep/testing.zig").withFile(std.testing.allocator, "x\n");
+ const p = try @import("ninep/harness.zig").withFile(std.testing.allocator, "x\n");
defer p.deinit();
var old = std.mem.zeroInit(Kind.Ops, .{ .head = std.mem.zeroInit(Kind.c.pa_head, .{ .size = @sizeOf(Kind.c.pa_head), .abi = Kind.abi, .version = 1 }), .open = Fake.open, .paint = Fake.paint, .dump = Fake.save, .load = Fake.load });
@memcpy(old.head.name[0..7], "migrate");
diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md
index d4034ca0..9b551e9b 100644
--- a/core/CHANGELOG.md
+++ b/core/CHANGELOG.md
@@ -58,6 +58,10 @@
running no longer crashes now and then, freeing its own core while
still answering it.
+- The tag word `Unattach` is `Undock`: a +Search docked under the pane it
+ answers for leaves it with `Undock`, and stays where it is, a pane of its
+ own. *Attach* is a client joining a session now; `Unattach` is an
+ unknown word, with no alias.
- The row after a file's last newline, where the cursor can sit and no
line is yet, shows `~` in the gutter where its line number was, as
helix's does.
diff --git a/core/Core.zig b/core/Core.zig
index d5a990e2..b109b073 100644
--- a/core/Core.zig
+++ b/core/Core.zig
@@ -288,7 +288,7 @@ session_home: [limits.host_path_cap]u8 = undefined,
session_home_len: ?u16 = null,
session_shell: [limits.host_path_cap]u8 = undefined,
session_shell_len: u16 = 0,
-settings: config.Runtime = .{ .font = .{ .tagline_percent = config.gui_tagline_font_percent } },
+settings: config.Settings = .{ .font = .{ .tagline_percent = config.gui_tagline_font_percent } },
locations_config: locations.Config = .{},
locations_cache: locations.Cache = .{},
tty_filter_palette: pardes.Term.FilterPalette = .{},
@@ -296,10 +296,10 @@ font_request_taken: bool = false,
custom_theme: ?Theme = null,
/// bodyChrome's: the theme it was worked out for, and it.
body_chrome: ?struct { theme: Theme, chrome: ChromeTheme } = null,
-theme_file_path: config.Runtime.Text(limits.host_path_cap) = .{},
+theme_file_path: config.Settings.Text(limits.host_path_cap) = .{},
/// The ThemeFile last loaded whole: what /ctl and DumpConfig name, and
/// what a failed ThemeFile goes back to (colors.revertThemeFile).
-theme_file_loaded: config.Runtime.Text(limits.host_path_cap) = .{},
+theme_file_loaded: config.Settings.Text(limits.host_path_cap) = .{},
theme_file_generation: u32 = 0,
theme_file_pane: u8 = 0,
chrome: colors.ChromeTheme = colors.initial_chrome,
@@ -1102,7 +1102,7 @@ fn observeFontInner(
p: *Pardes,
effective_name: []const u8,
effective_size_hundredths: u16,
- unit: config.Runtime.FontSizeUnit,
+ unit: config.Settings.FontSizeUnit,
) bool {
if (!p.settings.font.effective_name.set(effective_name)) return false;
p.settings.font.effective_size_hundredths = effective_size_hundredths;
@@ -1117,7 +1117,7 @@ fn acknowledgeFontInner(
p: *Pardes,
effective_name: []const u8,
effective_size_hundredths: u16,
- unit: config.Runtime.FontSizeUnit,
+ unit: config.Settings.FontSizeUnit,
) bool {
if (!p.settings.font.pending or !p.font_request_taken) return false;
const changed = !std.mem.eql(
@@ -2945,7 +2945,7 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe
// A body's click written back to event is done as the click: sent. A
// line written to exec came back as F and runs as the command it was.
{
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const event = ctlfs.Node.of(file.serial, .event);
const h = th.call(p, .{ .tag = 1, .op = .open, .node = event }).reply.handle;
defer _ = th.call(p, .{ .tag = 2, .op = .release, .node = event, .handle = h });
@@ -3039,7 +3039,7 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe
try std.testing.expect(Sent.len[1] == 0 and file.prompt == .none);
// The question is in the log, and a script answers it on the ctl.
{
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
_ = exec.executeFrom(p, 0, "print(5)", true);
var want: [32]u8 = undefined;
try std.testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "ask {d} repl a b\n", .{file.serial})));
@@ -3423,7 +3423,7 @@ test "Font keeps requested and acknowledged faces as separate plain state" {
try std.testing.expect(!p.settings.font.pending);
try std.testing.expectEqualStrings(installed[0].name, p.settings.font.effective_name.get());
try std.testing.expectEqual(@as(u16, 1375), p.settings.font.effective_size_hundredths);
- try std.testing.expectEqual(config.Runtime.FontSizeUnit.pixels, p.settings.font.effective_size_unit);
+ try std.testing.expectEqual(config.Settings.FontSizeUnit.pixels, p.settings.font.effective_size_unit);
try std.testing.expect(!p.acknowledgeFont("Duplicate Ack", 1400, .pixels));
try std.testing.expect(p.executeBuiltinLine(p.view().active, cmd));
@@ -3541,7 +3541,7 @@ test "Tab N draws every pane's tab N cells wide and clicks count past it; bare T
try std.testing.expect(p.executeBuiltinLine(0, "Tab 0"));
try std.testing.expectEqual(@as(u16, 8), p.settings.tab);
// The ctl read's tab column, and a Dump's settings.
- const ctl_text = @import("ninep/testing.zig").rd(p, ctlfs.Node.of(pane.serial, .ctl), 0, 4096).bytes;
+ const ctl_text = @import("ninep/harness.zig").rd(p, ctlfs.Node.of(pane.serial, .ctl), 0, 4096).bytes;
try std.testing.expect(std.mem.indexOf(u8, ctl_text, " 8 ") != null);
try dump.dumpState(p);
const restored = try dump.restore(p, p.dump_out.?, "/tmp/pardes.dump.zon");
diff --git a/core/Dir.zig b/core/Dir.zig
index a82887fb..29c5cdc8 100644
--- a/core/Dir.zig
+++ b/core/Dir.zig
@@ -430,7 +430,7 @@ test "an exec in a directory pane runs in its directory, and its +Errors goes th
}
test "over 9P a directory pane is a text pane whose name ends in /, its body the listing, ctl's isdir 1, and get reads it again" {
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const tree = @import("ninep/tree.zig");
var tmp = testing.tmpDir(.{});
defer tmp.cleanup();
diff --git a/core/Effect.zig b/core/Effect.zig
index 7166294f..7475cc84 100644
--- a/core/Effect.zig
+++ b/core/Effect.zig
@@ -681,7 +681,7 @@ test "a save path that names no file is refused before anything is rewritten" {
}
test "a Save the host could not do logs no save record" {
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const p = try th.withFile(std.testing.allocator, "x\n");
defer p.deinit();
const Failing = struct {
diff --git a/core/Handover.zig b/core/Handover.zig
index bcf42c31..dde31f8b 100644
--- a/core/Handover.zig
+++ b/core/Handover.zig
@@ -165,7 +165,7 @@ pub fn finish(h: *Handover, p: *Pardes, seq: u32, to: []const u8, failure: ?[]co
const pane = p.panes[id].?;
if (pane.file == null or pane.file.?.revision != revision) {
// Out of its group, or the owner's close would take it along.
- pane.attached_to = null;
+ pane.docked_to = null;
kept += 1;
continue;
}
@@ -277,7 +277,7 @@ pub fn adopt(p: *Pardes, bytes: []const u8) !usize {
for (st.owners, 0..) |owner, k| {
const at = owner orelse continue;
if (at >= n) continue;
- p.panes[slots[k]].?.attached_to = p.panes[slots[at]].?.serial;
+ p.panes[slots[k]].?.docked_to = p.panes[slots[at]].?.serial;
}
const tc = layout.targetColumn(p, x);
var heights: [MAX_PANES]u16 = @splat(0);
diff --git a/core/Output.zig b/core/Output.zig
index 3ac9f521..ab84ae35 100644
--- a/core/Output.zig
+++ b/core/Output.zig
@@ -705,7 +705,7 @@ pub fn openThemes(p: *Pardes, id: usize) !void {
for (pardes.themes, 0..) |t, i| {
if (pardes.colors.groupAt(i)) |title|
try out.writer.print("{s}# {s}\n", .{ if (i == 0) "" else "\n", title });
- try out.writer.print(comptime config.Runtime.findAction(.theme).?.word ++ " {s}\n", .{t.name});
+ try out.writer.print(comptime config.Settings.findAction(.theme).?.word ++ " {s}\n", .{t.name});
}
const content = try out.toOwnedSlice();
try openStepped(p, id, .{ .cmd = .Themes }, content);
@@ -716,7 +716,7 @@ pub fn isWalkRow(file: *const File.State, row: usize, line: []const u8) bool {
if (usesLocationsConfig(state.from) or std.meta.eql(state.from, Origin{ .query = .callstack })) return isResultRow(file, row);
if (!std.meta.eql(state.from, Origin{ .cmd = .Themes })) return true;
// Section labels are for reading, not stops in the command walk.
- return std.mem.startsWith(u8, std.mem.trimStart(u8, line, " \t"), comptime config.Runtime.findAction(.theme).?.word ++ " ");
+ return std.mem.startsWith(u8, std.mem.trimStart(u8, line, " \t"), comptime config.Settings.findAction(.theme).?.word ++ " ");
}
pub fn openFonts(p: *Pardes, id: usize) !void {
@@ -733,7 +733,7 @@ fn fontsListed(gpa: std.mem.Allocator, arena: std.mem.Allocator) anyerror![]u8 {
var out: std.Io.Writer.Allocating = .init(gpa);
errdefer out.deinit();
for (fonts.list(arena, null)) |f|
- try out.writer.print(comptime config.Runtime.findAction(.font).?.word ++ " {s}\n", .{f.name});
+ try out.writer.print(comptime config.Settings.findAction(.font).?.word ++ " {s}\n", .{f.name});
return out.toOwnedSlice();
}
@@ -852,7 +852,7 @@ pub fn openConfig(p: *Pardes, id: usize) !void {
var located: std.Io.Writer.Allocating = .init(p.gpa);
defer located.deinit();
try p.locations_config.write(&located.writer);
- try config.Runtime.writeReport(&out.writer, .{
+ try config.Settings.writeReport(&out.writer, .{
.locations = located.written(),
.default_dump_dir = p.tape.authority(dumpDirectory, .{@as([]u8, &dir_buf)}),
.startup_config_path = p.startupPath(),
diff --git a/core/Query.zig b/core/Query.zig
index dacc11a1..0cecb93e 100644
--- a/core/Query.zig
+++ b/core/Query.zig
@@ -200,16 +200,16 @@ fn freeSaved(gpa: std.mem.Allocator, s: Saved) void {
gpa.free(s.items);
}
-/// The owner's query pane (attached to it, or left where it was by
-/// Unattach): the one a later search from it reuses.
+/// The owner's query pane (docked to it, or left where it was by
+/// Undock): the one a later search from it reuses.
pub fn ofOwner(p: *Pardes, owner_serial: u32) ?usize {
var found: ?usize = null;
for (p.panes, 0..) |slot, i| {
const pane = slot orelse continue;
const q = pane.query orelse continue;
if (q.owner != owner_serial) continue;
- // the attached one first: an unattached one is a kept result
- if (pane.attached_to == owner_serial) return i;
+ // the docked one first: an undocked one is a kept result
+ if (pane.docked_to == owner_serial) return i;
found = found orelse i;
}
return found;
@@ -1754,7 +1754,7 @@ fn promote(p: *Pardes, qid: usize, id: usize) void {
// Its text was read from that file to preview it (displayPreview).
f.on_disk = filesystem.localPath(f.path) != null;
f.syntax_dirty = true;
- pane.attached_to = null;
+ pane.docked_to = null;
if (f.on_disk) p.recent.opened(p.recentGpa(), f.path);
if (filesystem.localPath(f.path) != null) p.emit(.{ .watch = .{ .pane = .at(id), .on = true } });
pardes.ctlfs.events.noteLog(p, .rename, pane);
@@ -1887,7 +1887,7 @@ pub fn cancel(p: *Pardes, id: usize) void {
// A preview made for the query Esc took back has no use: its rows
// go to the text whose rows they were.
if (previewOf(p, id)) |pid| {
- p.panes[pid].?.attached_to = null;
+ p.panes[pid].?.docked_to = null;
p.removePane(pid, owner_id) catch |err| p.reportError(.at(id), "query", err);
q.preview = 0;
}
@@ -2354,7 +2354,7 @@ test "Find: names fuzzy per keystroke, the group born with its +Preview, nothing
try std.testing.expectEqual(pv, p.view().active);
try std.testing.expectEqual(serial, p.panes[pv].?.serial);
try std.testing.expect(p.panes[pv].?.file.?.output == null);
- try std.testing.expect(p.panes[pv].?.attached_to == null);
+ try std.testing.expect(p.panes[pv].?.docked_to == null);
layout.compute(p);
try std.testing.expectEqualDeep(rect, p.view().rects[pv]);
try std.testing.expect(q.frozen);
@@ -2754,6 +2754,6 @@ test "a query row's address reaches every way a look arrives: an empty look writ
// the whole row written to the pane's look: the place
a.body.cur_row = 0;
const tree = @import("ninep/tree.zig");
- try std.testing.expectEqual(tree.Status.ok, @import("ninep/testing.zig").wr(p, tree.Node.of(qp.serial, .look), line).reply.status);
+ try std.testing.expectEqual(tree.Status.ok, @import("ninep/harness.zig").wr(p, tree.Node.of(qp.serial, .look), line).reply.status);
try std.testing.expectEqual(@as(i32, 3), a.body.cur_row);
}
diff --git a/core/builtins.zig b/core/builtins.zig
index 6f37e86d..a7340352 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -18,7 +18,7 @@ const keys = @import("keys.zig");
const Jump = @import("Jump.zig");
/// What this build's own frontend draws and its host does: the render's.
-pub const frontend: config.Runtime.Capabilities = .{
+pub const frontend: config.Settings.Capabilities = .{
.font_picker = pardes.font_picker,
// The tty's font belongs to its emulator.
.tagline_font_size = pardes.platform != .tui,
@@ -32,15 +32,15 @@ pub const frontend: config.Runtime.Capabilities = .{
/// its own frontend does (`viewCapabilities`), so a terminal's replica of a
/// window's session steps as the window's own does, and back.
pub const desktop = pardes.platform == .tui or pardes.platform == .gui;
-const window_capabilities: config.Runtime.Capabilities = .{ .font_picker = true, .tagline_font_size = true, .window_opacity = true, .pixels = true };
-const terminal_capabilities: config.Runtime.Capabilities = .{ .font_picker = false, .tagline_font_size = false, .window_opacity = false, .pixels = false };
+const window_capabilities: config.Settings.Capabilities = .{ .font_picker = true, .tagline_font_size = true, .window_opacity = true, .pixels = true };
+const terminal_capabilities: config.Settings.Capabilities = .{ .font_picker = false, .tagline_font_size = false, .window_opacity = false, .pixels = false };
/// The words this build has: a desktop build's are the window's.
-pub const capabilities: config.Runtime.Capabilities = if (desktop) window_capabilities else frontend;
+pub const capabilities: config.Settings.Capabilities = if (desktop) window_capabilities else frontend;
/// What the live view's frontend takes: a window's, or a terminal's
/// (`Pardes.frontend`, which its client says, Event.frontend).
-pub fn viewCapabilities(p: *const Pardes) config.Runtime.Capabilities {
+pub fn viewCapabilities(p: *const Pardes) config.Settings.Capabilities {
if (comptime !desktop) return frontend;
return if (p.view().frontend.windowed) window_capabilities else terminal_capabilities;
}
@@ -136,10 +136,10 @@ fn manualBuiltinList() []const type {
}
}
-fn settingList() []const config.Runtime.Setting {
+fn settingList() []const config.Settings.Setting {
comptime {
- var list: []const config.Runtime.Setting = &.{};
- for (config.Runtime.settings) |setting| if (setting.enabled(capabilities)) {
+ var list: []const config.Settings.Setting = &.{};
+ for (config.Settings.settings) |setting| if (setting.enabled(capabilities)) {
list = list ++ .{setting};
};
return list;
@@ -175,7 +175,7 @@ pub const registry = struct {
}
/// `here` for a frontend of these capabilities, windowed or not.
- pub fn hereFor(b: Builtin(), caps: config.Runtime.Capabilities, windowed: bool) bool {
+ pub fn hereFor(b: Builtin(), caps: config.Settings.Capabilities, windowed: bool) bool {
inline for (comptime manualBuiltinList(), 0..) |T, i| if (@backingInt(b) == i) return !@hasDecl(T, "in_window") or windowed;
inline for (comptime settingList(), comptime manualBuiltinList().len..) |setting, i| if (@backingInt(b) == i) return setting.enabled(caps);
unreachable;
@@ -1131,13 +1131,13 @@ pub const Collapse = struct {
}
};
-/// Unattach a pane from the pane it answers for: it stays where it is, a
+/// Undock a pane from the pane it answers for: it stays where it is, a
/// pane of its own, and the next search from that pane opens another
/// under it.
-pub const Unattach = struct {
+pub const Undock = struct {
pub fn run(c: Ctx) void {
- if (c.pane.attached_to == null) return c.p.reportFailure(c.id, "Unattach: not attached to a pane");
- c.pane.attached_to = null;
+ if (c.pane.docked_to == null) return c.p.reportFailure(c.id, "Undock: not docked to a pane");
+ c.pane.docked_to = null;
}
};
@@ -1873,7 +1873,7 @@ fn testDump(buf: []u8) ![]const u8 {
test "capabilities exactly gate setting builtins" {
const Builtin = registry.Builtin();
- for (config.Runtime.settings) |setting| {
+ for (config.Settings.settings) |setting| {
const registered = std.meta.stringToEnum(Builtin, setting.word) != null;
try std.testing.expectEqual(setting.enabled(capabilities), registered);
}
diff --git a/core/builtins_json.zig b/core/builtins_json.zig
index 3773e5ae..23e15098 100644
--- a/core/builtins_json.zig
+++ b/core/builtins_json.zig
@@ -65,11 +65,11 @@ pub fn write(w: *std.Io.Writer, addon_sources: []const []const u8) std.Io.Writer
try w.writeAll(if (builtins.registry.takesArg(b)) "true" else "false");
try w.writeAll(", \"scope\": ");
try str(if (b == .Edit) "both" else if (builtins.registry.scope(b) == .session) "root" else "pane", .{}, w);
- const setting = config.Runtime.find(name);
+ const setting = config.Settings.find(name);
try w.writeAll(", \"setting\": ");
try w.writeAll(if (setting != null) "true" else "false");
try w.writeAll(", \"choices\": ");
- if (setting) |s| if (config.Runtime.choices(s.action)) |v| try str(v, .{}, w) else try w.writeAll("null") else try w.writeAll("null");
+ if (setting) |s| if (config.Settings.choices(s.action)) |v| try str(v, .{}, w) else try w.writeAll("null") else try w.writeAll("null");
var buf: [2048]u8 = undefined;
const doc = if (setting) |s| s.doc else ctl.summaryOf(name, &buf);
try w.writeAll(", \"doc\": ");
diff --git a/core/config.zig b/core/config.zig
index 792a7e62..0032b03a 100644
--- a/core/config.zig
+++ b/core/config.zig
@@ -79,7 +79,7 @@ pub const leader_path = paths: {
.Mode = null,
.Togglettymode = null,
.Collapse = null,
- .Unattach = null,
+ .Undock = null,
.Undo = null,
.Edit = null,
.Redo = null,
@@ -600,7 +600,7 @@ pub const delete_word_forward: []const Chord = &.{ .{ .cp = 'd', .alt = true },
pub const kill_to_line_start: []const Chord = &.{.{ .cp = 'u', .ctrl = true }};
pub const kill_to_line_end: []const Chord = &.{.{ .cp = 'k', .ctrl = true }};
-pub const Runtime = struct {
+pub const Settings = struct {
theme: usize = 0,
wrap: bool = true,
debug: bool = false,
@@ -662,7 +662,7 @@ pub const Runtime = struct {
tab: u16 = tab_width,
callstack_depth: u8 = @import("lsp/lsp.zig").callstack_default_depth,
- /// A setting that is one of a few words, each an enum field of Runtime.
+ /// A setting that is one of a few words, each an enum field of Settings.
pub const Choice = enum { pet };
pub const Pet = enum { off, cat, frog };
@@ -710,7 +710,7 @@ pub const Runtime = struct {
};
// Validate the complete request before changing any member.
- pub fn requestFont(state: *Runtime, path: []const u8, name: []const u8, size_hundredths: u16) bool {
+ pub fn requestFont(state: *Settings, path: []const u8, name: []const u8, size_hundredths: u16) bool {
if (path.len > state.font.requested_path.bytes.len or
name.len > state.font.requested_name.bytes.len) return false;
if (size_hundredths != 0 and (size_hundredths < 800 or size_hundredths > 7200)) return false;
@@ -834,7 +834,7 @@ pub const Runtime = struct {
}
/// `home`: what `~` is (the session's: Pardes.session_home).
- pub fn apply(state: *Runtime, tape: *pardes.tape.Tape, setting: Setting, argument: ?[]const u8, home: ?[]const u8) bool {
+ pub fn apply(state: *Settings, tape: *pardes.tape.Tape, setting: Setting, argument: ?[]const u8, home: ?[]const u8) bool {
switch (setting.action) {
// Every toggle names a bool field of its own, so one line covers
// all of them and a new toggle needs no arm here. Bare, a toggle
@@ -903,7 +903,7 @@ pub const Runtime = struct {
return switch (action) {
.toggle => "on, off",
.choice => |which| switch (which) {
- inline else => |field| comptime words.of(@FieldType(Runtime, @tagName(field))),
+ inline else => |field| comptime words.of(@FieldType(Settings, @tagName(field))),
},
else => null,
};
@@ -970,7 +970,7 @@ pub const Runtime = struct {
default_dump_dir: []const u8 = "",
native_images: bool = false,
capabilities: Capabilities,
- state: *const Runtime,
+ state: *const Settings,
/// The `LocationsConfig` argument in effect, as it would be typed.
locations: []const u8 = "",
};
@@ -1068,7 +1068,7 @@ pub const Runtime = struct {
}
test "a toggle flips when bare and sets when told on or off" {
- var state: Runtime = .{};
+ var state: Settings = .{};
const verbose = find("Verbose").?;
try std.testing.expect(state.verbose);
// Bare, it flips: that is what a tagline word does.
@@ -1090,7 +1090,7 @@ pub const Runtime = struct {
}
test "simple setting application mutates only its plain field" {
- var state: Runtime = .{};
+ var state: Settings = .{};
try std.testing.expect(apply(&state, &pardes.tape.none, find("Wrap").?, null, null));
try std.testing.expect(!state.wrap);
try std.testing.expect(apply(&state, &pardes.tape.none, find("Shell").?, " fish\n", null));
@@ -1100,7 +1100,7 @@ pub const Runtime = struct {
test "tagline size validates before mutating live state" {
const setting = find("TaglineSize").?;
- var state: Runtime = .{};
+ var state: Settings = .{};
for ([_][]const u8{ "1", " 82\n", "100" }) |argument| {
try std.testing.expect(apply(&state, &pardes.tape.none, setting, argument, null));
@@ -1116,7 +1116,7 @@ pub const Runtime = struct {
test "window opacity defaults to opaque validates atomically and retries" {
const setting = find("WindowOpacity").?;
- var state: Runtime = .{};
+ var state: Settings = .{};
try std.testing.expectEqual(@as(u8, 100), state.window_opacity);
try std.testing.expect(state.window_opacity_pending);
try std.testing.expectEqual(Capability.window_opacity, availability(setting.action).?);
@@ -1141,7 +1141,7 @@ pub const Runtime = struct {
}
test "font request tuple rejects atomically" {
- var state: Runtime = .{};
+ var state: Settings = .{};
try std.testing.expect(requestFont(&state, "/fonts/old.ttf", "Old", 1200));
var too_long: [256]u8 = @splat('x');
try std.testing.expect(!requestFont(&state, "/fonts/new.ttf", &too_long, 1800));
@@ -1168,7 +1168,7 @@ pub const Runtime = struct {
// The switches, Theme, Shell, Pager and the shell's own lines are
// test/behaviour/settings.zig's, read through the root ctl and the
// +DumpConfig pane.
- var state: Runtime = .{};
+ var state: Settings = .{};
// Every setting, every context line: the report outgrows 4K.
var storage: [8192]u8 = undefined;
const context: ReportContext = .{
@@ -1219,7 +1219,7 @@ pub const Runtime = struct {
"# Native images: on\n",
}) |expected| try std.testing.expect(std.mem.indexOf(u8, report, expected) != null);
- var defaults: Runtime = .{};
+ var defaults: Settings = .{};
var defaults_context = context;
defaults_context.startup_config_path = null;
defaults_context.platform = "tui";
@@ -1693,7 +1693,7 @@ test "wheel drift guard" {
}
test {
- _ = Runtime;
+ _ = Settings;
_ = User;
}
@@ -1838,14 +1838,14 @@ test "reference.typ's #fstree is the tree the session serves, file for file" {
}
test "CallstackDepth is bounded and keeps the last valid runtime limit" {
- var state: Runtime = .{};
+ var state: Settings = .{};
try std.testing.expectEqual(@as(u8, 8), state.callstack_depth);
for ([_][]const u8{ "1", "8", "16", "64" }) |value| {
- try std.testing.expect(Runtime.apply(&state, &pardes.tape.none, Runtime.find("CallstackDepth").?, value, null));
+ try std.testing.expect(Settings.apply(&state, &pardes.tape.none, Settings.find("CallstackDepth").?, value, null));
try std.testing.expectEqual(try std.fmt.parseInt(u8, value, 10), state.callstack_depth);
}
for ([_][]const u8{ "0", "65", "256", "-1", "+8", "1_6", "eight", "" }) |value| {
- try std.testing.expect(!Runtime.apply(&state, &pardes.tape.none, Runtime.find("CallstackDepth").?, value, null));
+ try std.testing.expect(!Settings.apply(&state, &pardes.tape.none, Settings.find("CallstackDepth").?, value, null));
try std.testing.expectEqual(@as(u8, 64), state.callstack_depth);
}
}
diff --git a/core/dump.zig b/core/dump.zig
index 1616f557..a8dd170a 100644
--- a/core/dump.zig
+++ b/core/dump.zig
@@ -708,11 +708,11 @@ pub fn savePane(gpa: std.mem.Allocator, pane: *pardes.panes.Pane, slim: bool) ![
// The fields it changes put back after, not the whole pane (88 KB) kept
// aside: a store record is made at every close.
const cwd = pane.cwd;
- const attached_to = pane.attached_to;
+ const docked_to = pane.docked_to;
const terminal = pane.terminal;
defer {
pane.cwd = cwd;
- pane.attached_to = attached_to;
+ pane.docked_to = docked_to;
pane.terminal = terminal;
}
if (cwd == .inherited) {
@@ -720,7 +720,7 @@ pub fn savePane(gpa: std.mem.Allocator, pane: *pardes.panes.Pane, slim: bool) ![
const dir = pane.cwdSlice();
pane.cwd = .{ .owned = @constCast(dir) };
}
- pane.attached_to = null;
+ pane.docked_to = null;
if (!slim) return walk.save(pardes.panes.Pane, gpa, pane);
pane.terminal = null;
const f = if (pane.file) |*file| file else return walk.save(pardes.panes.Pane, gpa, pane);
@@ -985,7 +985,7 @@ test "a session with every column it may hold dumps and restores them all" {
}
test "a restored session's column and workspace tags take more than one selection, and its 9P files have a time" {
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true });
defer p.deinit();
@@ -1037,7 +1037,7 @@ test "a pane restored with unsaved text is asked about by Exit, Restore, Del and
const id = for (restored.panes, 0..) |slot, i| {
if (slot) |candidate| if (candidate.file != null and candidate.file.?.output == null) break i;
} else return error.FileLost;
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const node = if (word == .Del or word == .get)
ctlfs.Node.of(restored.panes[id].?.serial, .ctl)
else
@@ -1171,7 +1171,7 @@ test "a session's byte dump read by name, field by field as another build reads
test "an old dump's file, a byte dump, is read by -l and by a Restore of its path, for one release" {
const gpa = std.testing.allocator;
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const p = try Pardes.init(gpa, .{ .tty_only = true });
defer p.deinit();
_ = try p.setTestFile("kept in a .dump\n");
diff --git a/core/edit_cmd.zig b/core/edit_cmd.zig
index 43006503..9f1f7862 100644
--- a/core/edit_cmd.zig
+++ b/core/edit_cmd.zig
@@ -452,7 +452,7 @@ fn commit(p: *Pardes, pd: *Pending, outputs: []const []const u8) void {
}
const testing = std.testing;
-const th = @import("ninep/testing.zig");
+const th = @import("ninep/harness.zig");
const tree = @import("ninep/tree.zig");
/// The answer of the Edit waiting on its commands: as a host's worker
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());
},
}
diff --git a/core/fs.zig b/core/fs.zig
index 0a10825d..0797beb0 100644
--- a/core/fs.zig
+++ b/core/fs.zig
@@ -11,7 +11,7 @@ const modal = @import("modal.zig");
const look = @import("look.zig");
pub const tree = @import("ninep/tree.zig");
const sources_fs = @import("ninep/sources.zig");
-const th = @import("ninep/testing.zig");
+const th = @import("ninep/harness.zig");
const Pardes = pardes.Pardes;
const MAX_PANES = pardes.MAX_PANES;
diff --git a/core/keys.zig b/core/keys.zig
index 92e78b0e..72e3bb3b 100644
--- a/core/keys.zig
+++ b/core/keys.zig
@@ -632,7 +632,7 @@ test "Del from a key asks which neighbour takes the rows; nothing else asks" {
p.newScratchBelow(foot);
const tail = p.view().active;
{
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const asked = foot;
p.view().active = asked;
p.sync();
diff --git a/core/layout.zig b/core/layout.zig
index 6ce0845f..9c99dc7d 100644
--- a/core/layout.zig
+++ b/core/layout.zig
@@ -339,7 +339,7 @@ pub fn movePane(p: *Pardes, id: usize, cur_x: u16, cur_y: u16) void {
for (moved[0..count], 0..) |m, j| insert(p, placement.preview_col, j, m);
if (count > 1) setColumnWeights(p, placement.preview_col, &heights);
if (source_multi) setColumnWeights(p, src.col, &heights);
- if (owner != null) p.panes[id].?.attached_to = null;
+ if (owner != null) p.panes[id].?.docked_to = null;
return;
};
const af = findPane(p, above) orelse return;
@@ -367,7 +367,7 @@ pub fn movePane(p: *Pardes, id: usize, cur_x: u16, cur_y: u16) void {
const pane = p.panes[id].?;
// Still right under its owner's group: resized there. Anywhere
// else it is a pane of its own.
- if (af.col != (findPane(p, o) orelse return).col or !descends(p, above, o)) pane.attached_to = null;
+ if (af.col != (findPane(p, o) orelse return).col or !descends(p, above, o)) pane.docked_to = null;
}
}
@@ -1115,7 +1115,7 @@ pub fn splitBelow(p: *Pardes, src_id: usize, nw: *Pane) void {
// ---- Attached panes ----
//
// A results pane (+Search, +Callstack, +Diff, +Errors) is ATTACHED to the
-// pane it answers for, its owner (Pane.attached_to). The owner and what is
+// pane it answers for, its owner (Pane.docked_to). The owner and what is
// attached to it, and what is attached to those (a preview under a
// +Search), are a GROUP: contiguous in one column, the owner first. A group
// is one place to everything else in the layout: an unrelated pane is never
@@ -1126,7 +1126,7 @@ pub fn splitBelow(p: *Pardes, src_id: usize, nw: *Pane) void {
/// The slot of `id`'s owner, when `id` is attached to a live pane.
pub fn ownerOf(p: *const Pardes, id: usize) ?usize {
- const serial = (p.panes[id] orelse return null).attached_to orelse return null;
+ const serial = (p.panes[id] orelse return null).docked_to orelse return null;
for (p.panes, 0..) |slot, i| if (slot) |pane| if (pane.serial == serial and i != id) return i;
return null;
}
@@ -1168,10 +1168,10 @@ pub fn groupEnd(p: *const Pardes, c: usize, idx: usize) usize {
pub fn keepGroups(p: *Pardes) void {
for (0..p.view().ncol) |c| for (p.view().cols[c].panes[0..p.view().cols[c].n], 0..) |id, k| {
const pane = p.panes[id] orelse continue;
- if (pane.attached_to == null) continue;
+ if (pane.docked_to == null) continue;
const kept = if (ownerOf(p, id)) |owner| k > 0 and descends(p, p.view().cols[c].panes[k - 1], owner) else false;
if (kept) continue;
- pane.attached_to = null;
+ pane.docked_to = null;
};
}
@@ -1206,7 +1206,7 @@ pub fn attachFrom(p: *Pardes, owner: usize, id: usize, rows: u16, giver: usize)
insert(p, f.col, groupEnd(p, f.col, f.idx), id);
g.vweight = @floatFromInt(oh - give);
nw.vweight = @floatFromInt(give);
- nw.attached_to = o.serial;
+ nw.docked_to = o.serial;
compute(p);
return true;
}
@@ -1991,9 +1991,9 @@ test "an attachment survives Dump and Restore, and one left away from its owner
const restored = try dump.initFromDump(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 }, p.dump_out.?);
defer restored.deinit();
try std.testing.expectEqual(@as(?usize, 0), ownerOf(restored, s));
- // Unattach: a pane of its own where it stands.
- pardes.exec.runBuiltin(p, .Unattach, s, "", null);
- try std.testing.expect(p.panes[s].?.attached_to == null);
+ // Undock: a pane of its own where it stands.
+ pardes.exec.runBuiltin(p, .Undock, s, "", null);
+ try std.testing.expect(p.panes[s].?.docked_to == null);
// Put above its owner by a route that does not carry groups: detached.
const t = try testAttachment(p);
try std.testing.expect(attachFrom(p, 0, t, 8, 0));
@@ -2001,7 +2001,7 @@ test "an attachment survives Dump and Restore, and one left away from its owner
removePane(p, t);
insert(p, 0, 0, t);
compute(p);
- try std.testing.expect(p.panes[t].?.attached_to == null);
+ try std.testing.expect(p.panes[t].?.docked_to == null);
}
test "a new column takes width only from the column that created it" {
diff --git a/core/look.zig b/core/look.zig
index f7084079..1023a532 100644
--- a/core/look.zig
+++ b/core/look.zig
@@ -2302,7 +2302,7 @@ test "every entry point to Look takes one expansion: a diff line and a file:12:5
var fx: DiffFixture = undefined;
try fx.init(true, &.{.{ "src/x.zig", numbered }}, diff_text);
defer fx.tmp.cleanup();
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
// `column` -1: wherever a click puts it, every other way the same.
const Case = struct { text: []const u8, name: []const u8, row: u16, col: u16, sweep: [2]u16, line: i32, column: i32 };
const cases = [_]Case{
@@ -2391,7 +2391,7 @@ test "a tag word looked at by a click and by Enter is one record to an event rea
var fx: DiffFixture = undefined;
try fx.init(true, &.{.{ "src/x.zig", "line one\n" }}, diff_text);
defer fx.tmp.cleanup();
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const p = try Pardes.init(std.testing.allocator, .{ .cols = 100, .rows = 30 });
defer p.deinit();
const pane = try fx.open(p, diff_text);
diff --git a/core/mouse.zig b/core/mouse.zig
index 3d7c5af9..cefc0335 100644
--- a/core/mouse.zig
+++ b/core/mouse.zig
@@ -1497,7 +1497,7 @@ test "mouse thumb buttons navigate once and clear selection gestures" {
}
test "a chorded exec an event reader holds is told with its argument, and written back runs with it" {
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const p = try th.withFile(std.testing.allocator, "Msg said\narg-text\n");
defer p.deinit();
const serial = p.panes[0].?.serial;
diff --git a/core/ninep/addr.zig b/core/ninep/addr.zig
index 72a2d815..fd343363 100644
--- a/core/ninep/addr.zig
+++ b/core/ninep/addr.zig
@@ -319,7 +319,7 @@ pub const Addr = struct {
};
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const tree = @import("tree.zig");
const Node = tree.Node;
const E = tree.E;
diff --git a/core/ninep/cols.zig b/core/ninep/cols.zig
index 561a5ffa..88d8ef88 100644
--- a/core/ninep/cols.zig
+++ b/core/ninep/cols.zig
@@ -241,7 +241,7 @@ pub fn remove(p: *Pardes, req: Req, serial: u32, file: tree.ColFile) Reply {
// ---- tests ----
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const Node = tree.Node;
test "New written to a column's exec makes its scratch in the session's directory, as tagexec's does" {
diff --git a/core/ninep/ctl.zig b/core/ninep/ctl.zig
index 302b916a..7b4e2754 100644
--- a/core/ninep/ctl.zig
+++ b/core/ninep/ctl.zig
@@ -298,7 +298,7 @@ pub fn captured(p: *Pardes, req: Req, id: usize, exec: bool, text: []const u8, i
// ...and one that takes none, written with one (`Config extra`):
// refused as a ctl's is, not run as a shell command of that name.
if (std.mem.indexOfAny(u8, cmd, " \t")) |sp| if (std.meta.stringToEnum(Builtin, cmd[0..sp])) |b| {
- if (!builtins.registry.takesArg(b) and config.Runtime.find(cmd[0..sp]) == null) {
+ if (!builtins.registry.takesArg(b) and config.Settings.find(cmd[0..sp]) == null) {
p.fs.results_len = 0;
return refuse(p, req, "wrong #args in control message", cmd);
}
@@ -535,7 +535,7 @@ fn checkBuiltin(p: *Pardes, req: Req, line: []const u8, scope: builtins.Scope) ?
// A setting this build's frontend cannot show (Lift, GripWidth on a
// terminal, the window's own words in a terminal's view) is known,
// and says so rather than sound misspelt.
- if (builtins.absentWhy(word) orelse if (config.Runtime.find(word) != null or std.meta.stringToEnum(Builtin, word) != null) @as([]const u8, "GUI-only") else null) |absent| {
+ if (builtins.absentWhy(word) orelse if (config.Settings.find(word) != null or std.meta.stringToEnum(Builtin, word) != null) @as([]const u8, "GUI-only") else null) |absent| {
var why: pardes.Kind.Buf(64) = .{};
// EINVAL, a request this build cannot take, in words 9ns reads
// as that: `invalid`.
@@ -553,7 +553,7 @@ fn checkBuiltin(p: *Pardes, req: Req, line: []const u8, scope: builtins.Scope) ?
": write it to pane/<n>/ctl");
if (arg.len > 0 and !builtins.registry.takesArg(b)) return refuse(p, req, "wrong #args in control message", line);
if (arg.len == 0 and builtins.registry.requiresArg(b)) return refuse(p, req, "wrong #args in control message", line);
- const setting = config.Runtime.find(word) orelse return null;
+ const setting = config.Settings.find(word) orelse return null;
const takes = switch (setting.action) {
.theme => if (pardes.colors.themeIndex(arg) != null) true else {
// `refuse` quotes the line after it, all in the 128 bytes an
@@ -565,7 +565,7 @@ fn checkBuiltin(p: *Pardes, req: Req, line: []const u8, scope: builtins.Scope) ?
var why: pardes.Kind.Buf(256) = .{};
return refuse(p, req, why.print(head ++ "{s}" ++ tail, .{pardes.colors.themesNear(near[0..@min(room, near.len)], arg)}), arg);
},
- .font => config.Runtime.FontSpec.parse(arg) != null,
+ .font => config.Settings.FontSpec.parse(arg) != null,
// Bare, it says the width, as from a pane's exec.
.tab => arg.len == 0 or (std.fmt.parseInt(u16, arg, 10) catch 0) -% 1 < 16,
.callstack_depth => arg.len == 0 or (std.fmt.parseInt(u8, arg, 10) catch 0) -% 1 < pardes.lsp.callstack_max_depth,
@@ -578,7 +578,7 @@ fn checkBuiltin(p: *Pardes, req: Req, line: []const u8, scope: builtins.Scope) ?
var why: pardes.Kind.Buf(160) = .{};
// The offending word is the value: quoted, so two bad values read,
// and log, as two.
- return refuseQuoting(p, req, if (config.Runtime.takes(setting.action)) |values|
+ return refuseQuoting(p, req, if (config.Settings.takes(setting.action)) |values|
why.print("bad value in control message; takes {s}", .{values})
else
"bad value in control message", arg, "");
@@ -628,13 +628,13 @@ fn writeSettings(p: *Pardes, w: *std.Io.Writer) !void {
/// The setting words of `s`, one a line, those a frontend of `caps` takes
/// (the root ctl's: the live view's), and the session's LocationsConfig.
-fn writeSettingsFor(p: *Pardes, s: *const config.Runtime, w: *std.Io.Writer, caps: config.Runtime.Capabilities) !void {
+fn writeSettingsFor(p: *Pardes, s: *const config.Settings, w: *std.Io.Writer, caps: config.Settings.Capabilities) !void {
// DumpConfig's words: a `# Word unsupported` comment for what `caps` lacks.
var dump_dir: [1024]u8 = undefined;
var located_buf: [256]u8 = undefined;
var located: std.Io.Writer = .fixed(&located_buf);
try p.locations_config.write(&located);
- try config.Runtime.writeSettings(w, .{
+ try config.Settings.writeSettings(w, .{
.locations = located.buffered(),
.theme_name = p.theme().name,
.theme_file = pardes.colors.loadedThemeFile(p),
@@ -879,7 +879,7 @@ fn writeCommands(p: *const Pardes, w: *std.Io.Writer) !void {
});
// A setting that chooses among words: the words, comma-joined. Bare,
// it steps to the next of them (a two-valued one flips).
- if (config.Runtime.find(@tagName(b))) |setting| if (config.Runtime.choices(setting.action)) |values| {
+ if (config.Settings.find(@tagName(b))) |setting| if (config.Settings.choices(setting.action)) |values| {
try w.writeByte(' ');
var parts = std.mem.splitSequence(u8, values, ", ");
var first = true;
@@ -887,7 +887,7 @@ fn writeCommands(p: *const Pardes, w: *std.Io.Writer) !void {
};
// Then ` -- ` and what it does: a setting's doc, else its source's.
var summary_buf: [2048]u8 = undefined;
- const summary = if (config.Runtime.find(@tagName(b))) |setting| setting.doc else summaryOf(@tagName(b), &summary_buf);
+ const summary = if (config.Settings.find(@tagName(b))) |setting| setting.doc else summaryOf(@tagName(b), &summary_buf);
if (summary.len > 0) {
// The sentence whole unless it is long, then cut between words.
const kept = @import("../Messages.zig").clip(summary, 240);
@@ -1323,7 +1323,7 @@ pub fn get(p: *Pardes, pane: *Pane) GetError!void {
// ---- tests ----
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const call = th.call;
const rd = th.rd;
const wr = th.wr;
@@ -1374,7 +1374,7 @@ test "commands lists every builtin with its argument and the ctl that takes it"
const b = std.meta.stringToEnum(Builtin, words.next().?).?;
if (builtins.registry.takesArg(b)) try testing.expectEqualStrings("arg", words.next().?);
try testing.expectEqualStrings(if (b == .Edit) "both" else if (builtins.registry.scope(b) == .session) "root" else "pane", words.next().?);
- if (config.Runtime.find(@tagName(b))) |s| if (config.Runtime.choices(s.action) != null) try testing.expect(words.next() != null);
+ if (config.Settings.find(@tagName(b))) |s| if (config.Settings.choices(s.action) != null) try testing.expect(words.next() != null);
// Then, where the source has one, ` -- ` and what it does.
if (words.next()) |dashes| try testing.expectEqualStrings("--", dashes);
}
@@ -1766,7 +1766,7 @@ test "after a ThemeFile the root ctl and DumpConfig say ThemeFile and its path,
try testing.expect(std.mem.indexOf(u8, settings, "Theme mine") == null);
var storage: [16384]u8 = undefined;
var out: std.Io.Writer = .fixed(&storage);
- try config.Runtime.writeReport(&out, .{
+ try config.Settings.writeReport(&out, .{
.startup_config_path = null,
.platform = @tagName(pardes.platform),
.theme_name = p.theme().name,
@@ -2490,7 +2490,7 @@ test "every word's /commands description is its own doc comment's first sentence
continue;
};
const word = line[0..std.mem.indexOfScalar(u8, line, ' ').?];
- if (config.Runtime.find(word)) |setting| {
+ if (config.Settings.find(word)) |setting| {
try testing.expect(std.mem.endsWith(u8, line, setting.doc));
continue;
}
@@ -2890,7 +2890,7 @@ test "the init file reads past a BOM, and every line it fails is a notice and an
}
test "a setting the other frontend has is passed over in the init file, not failed" {
- const other = for (config.Runtime.settings) |s| {
+ const other = for (config.Settings.settings) |s| {
if (!s.enabled(pardes.builtins.capabilities)) break s.word;
} else return; // this frontend has them all
var text: [64]u8 = undefined;
diff --git a/core/ninep/events.zig b/core/ninep/events.zig
index 93a1187a..1951a434 100644
--- a/core/ninep/events.zig
+++ b/core/ninep/events.zig
@@ -828,7 +828,7 @@ pub fn writeEvent(p: *Pardes, asked: Req, id: usize) Reply {
// ---- tests ----
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const call = th.call;
const rd = th.rd;
const wr = th.wr;
diff --git a/core/ninep/testing.zig b/core/ninep/harness.zig
index cf75d80d..cf75d80d 100644
--- a/core/ninep/testing.zig
+++ b/core/ninep/harness.zig
diff --git a/core/ninep/pane.zig b/core/ninep/pane.zig
index 8be26602..1d514a3c 100644
--- a/core/ninep/pane.zig
+++ b/core/ninep/pane.zig
@@ -1031,7 +1031,7 @@ pub fn truncate(p: *Pardes, pane: *Pane, file: PaneFile) tree.Status {
// ---- tests ----
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const call = th.call;
const rd = th.rd;
const wr = th.wr;
diff --git a/core/ninep/pty.zig b/core/ninep/pty.zig
index 6f3a8af0..26bb7661 100644
--- a/core/ninep/pty.zig
+++ b/core/ninep/pty.zig
@@ -469,7 +469,7 @@ pub fn writeData(p: *Pardes, req: Req, id: usize) Reply {
// ---- tests ----
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const events = @import("events.zig");
const call = th.call;
const rd = th.rd;
diff --git a/core/ninep/screen.zig b/core/ninep/screen.zig
index 1e2791b1..1e31bac0 100644
--- a/core/ninep/screen.zig
+++ b/core/ninep/screen.zig
@@ -83,7 +83,7 @@ pub fn listenersText(p: *Pardes) std.Io.Writer.Error![]const u8 {
// ---- tests ----
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const fs = @import("../fs.zig");
const call = th.call;
const rd = th.rd;
diff --git a/core/ninep/sources.zig b/core/ninep/sources.zig
index 1d804e31..540506d4 100644
--- a/core/ninep/sources.zig
+++ b/core/ninep/sources.zig
@@ -109,7 +109,7 @@ pub fn handle(p: *Pardes, req: Req) Reply {
}
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const limits = @import("../memory.zig").limits;
test "embedded sources appear under the root only when the build carries them" {
diff --git a/core/ninep/tree.zig b/core/ninep/tree.zig
index d5a6b2fe..46a4e3d2 100644
--- a/core/ninep/tree.zig
+++ b/core/ninep/tree.zig
@@ -1504,7 +1504,7 @@ fn writeSend(p: *Pardes, req: Req) Reply {
// ---- tests ----
const testing = std.testing;
-const th = @import("testing.zig");
+const th = @import("harness.zig");
const config = @import("../config.zig");
const call = th.call;
const rd = th.rd;
diff --git a/core/panes.zig b/core/panes.zig
index b928917a..72ca3eea 100644
--- a/core/panes.zig
+++ b/core/panes.zig
@@ -144,7 +144,7 @@ pub const Pane = struct {
/// closes with it (layout.zig, "Attached panes"). An owner that is
/// gone, or a pane no longer right under its owner's group, leaves it
/// an ordinary pane (layout.keepGroups).
- attached_to: ?u32 = null,
+ docked_to: ?u32 = null,
/// This pane is a query pane: its line 1 the query, its rows made live
/// from a source (Query.zig, gpa-owned).
query: ?*Query = null,
@@ -1437,7 +1437,7 @@ pub fn removePane(p: *Pardes, id: usize, to: ?usize) error{OutOfMemory}!void {
const pane = p.panes[id] orelse return;
// What is attached to it closes with it, first, each giving its rows
// back to it: then its rows, theirs among them, go where a pane's go.
- for (0..p.panes.len) |k| if (p.panes[k]) |other| if (k != id and other.attached_to == pane.serial) {
+ for (0..p.panes.len) |k| if (p.panes[k]) |other| if (k != id and other.docked_to == pane.serial) {
if (layout.ownerOf(p, k) != id) continue;
try p.removePane(k, id);
layout.compute(p);
diff --git a/core/sam_edit.zig b/core/sam_edit.zig
index 0f4a70ba..700c2c01 100644
--- a/core/sam_edit.zig
+++ b/core/sam_edit.zig
@@ -1158,7 +1158,7 @@ fn expectEdit(text: []const u8, command: []const u8, want: []const u8) !void {
}
test "an x over 100k lines is 100k searches, each with its own step budget" {
- const th = @import("ninep/testing.zig");
+ const th = @import("ninep/harness.zig");
const line = &@as([80]u8, @splat('x')) ++ "\n";
const text = try std.testing.allocator.alloc(u8, line.len * 100_000);
defer std.testing.allocator.free(text);
diff --git a/core/surface.zig b/core/surface.zig
index fdcb52c8..6e05f25f 100644
--- a/core/surface.zig
+++ b/core/surface.zig
@@ -221,7 +221,7 @@ pub const Facts = struct {
forward: bool = false,
cursor_blink: bool = true,
jump_trail: bool = false,
- pet: config.Runtime.Pet = .off,
+ pet: config.Settings.Pet = .off,
inactive_dim: u8 = 0,
tagline_percent: u8 = 100,
diff --git a/core/tagline.zig b/core/tagline.zig
index 456a6b6e..fa25b2c1 100644
--- a/core/tagline.zig
+++ b/core/tagline.zig
@@ -35,9 +35,9 @@ pub const terminal_pane_tail = " " ++ config.terminal_pane_builtins_str;
pub const command_pane_tail = " " ++ config.command_pane_builtins_str;
pub const dir_pane_tail = " " ++ config.dir_pane_builtins_str;
/// A query pane's while its rows are made (Query.zig), and once Enter froze
-/// them into text a Save keeps; Unattach leaves it where it stands.
+/// them into text a Save keeps; Undock leaves it where it stands.
pub const query_live_tail = " Del";
-pub const query_frozen_tail = " Save Unattach Del";
+pub const query_frozen_tail = " Save Undock Del";
/// ...and while its Grep waits at 2000 lines for More (Stream.zig).
pub const query_capped_tail = " More Del";
/// A file with changes it has not saved.
diff --git a/core/tape.zig b/core/tape.zig
index 00486666..5ba999bf 100644
--- a/core/tape.zig
+++ b/core/tape.zig
@@ -1777,7 +1777,7 @@ test "every place that sets the global tape aside sets the core's field aside: a
test "a client's frame drawn between its steps records nothing into its idle tape" {
const gpa = std.testing.allocator;
- const p = try @import("ninep/testing.zig").withFile(gpa, "x\n");
+ const p = try @import("ninep/harness.zig").withFile(gpa, "x\n");
defer p.deinit();
const bytes = try pardes.dump.dumpBytes(p);
defer p.gpa.free(bytes);
diff --git a/core/views.zig b/core/views.zig
index 9985288d..89dcb454 100644
--- a/core/views.zig
+++ b/core/views.zig
@@ -33,7 +33,7 @@ pub const max = 4;
/// A pane's fields that are each view's own: where it is in the view's
/// layout, which of its texts has the keyboard, how far it is scrolled, and
/// what the view's step measured of it (its tag's rows, its bands).
-const pane_fields = [_][:0]const u8{ "focus", "vweight", "collapsed", "attached_to", "hscroll", "tag_scroll", "tag_top", "tag_rows", "view", "notices", "pan", "follow_scroll" };
+const pane_fields = [_][:0]const u8{ "focus", "vweight", "collapsed", "docked_to", "hscroll", "tag_scroll", "tag_top", "tag_rows", "view", "notices", "pan", "follow_scroll" };
/// The body's: its cursor, selections and mode. Its undo stays the pane's.
const body_fields = [_][:0]const u8{ "mode", "cur_pinned", "cur_row", "cur_col", "vsel", "sels", "nsel", "select", "sticky_col", "restore_cursor", "last_edit", "reg_wait", "normal", "find_op", "find_ch" };
@@ -43,7 +43,7 @@ pub const PaneView = struct {
focus: Pane.Focus = .body,
vweight: f32 = 1,
collapsed: bool = false,
- attached_to: ?u32 = null,
+ docked_to: ?u32 = null,
hscroll: i32 = 0,
tag_scroll: u16 = 0,
tag_top: u16 = 0,