From 52049344c1992850ea712e029eb5c4a88a7dfe19 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 27 Sep 2026 22:30:58 -0300 Subject: Move exec out of pardes.zig into exec.zig Pure move, no behaviour change (acme keeps this in exec.c): execute, commandText, max_exec_depth, executeBuiltinLine, applyStartupConfig, runBuiltin and applySettingBuiltin; the getarg-style operand code (withArg, PointerOperand, pointerOperand, heldSelection, chordEachSel); takesCommandLine and the terminals commands run in (spawnTty, spawnV9fsTty, spawnTtyWithMount, evictLonePristineTty, replaceStillborn, ttyForDir); placeDoc; and the save path (submitSave, saveFile, saveTo, askWrite), with the acme-chords test, go verbatim to exec.zig. The methods become free functions taking `p: *Pardes`. executeBuiltinLine is called from ~170 places as `p.executeBuiltinLine(..)`, so Pardes keeps one declaration alias for it and those call sites stay; the other 104 calls change from `p.execute(..)` to `exec.execute(p, ..)`. ninep/ctl.zig has a local named exec, so it writes `pardes.exec.execute` instead of importing the file. Co-Authored-By: Claude Opus 5.5 --- test/panes.zig | 6 +++--- test/pdf.zig | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/panes.zig b/test/panes.zig index f45d42b2..f99f9d56 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -721,7 +721,7 @@ const TtySelectionTests = struct { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 40, .rows = 24 }); defer p.deinit(); p.presentation.enabled = false; - p.spawnTty(0); + pardes.exec.spawnTty(p, 0); for (p.panes[0..2]) |slot| { slot.?.mode = .tty; slot.?.tty_filter = false; @@ -3111,8 +3111,8 @@ const TerminalTests = struct { defer p.deinit(); while (p.nextEffect()) |_| {} // the host has not acknowledged spawn yet - try std.testing.expectEqual(@as(?usize, 0), p.execute(0, "echo first")); - try std.testing.expectEqual(@as(?usize, 0), p.execute(0, "echo second")); + try std.testing.expectEqual(@as(?usize, 0), pardes.exec.execute(p, 0, "echo first")); + try std.testing.expectEqual(@as(?usize, 0), pardes.exec.execute(p, 0, "echo second")); while (p.nextEffect()) |effect| switch (effect) { .write => return error.CommandEscapedBeforeFork, else => {}, diff --git a/test/pdf.zig b/test/pdf.zig index 69a82123..dde58df8 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -342,7 +342,7 @@ test "PdfSections Look follows the exact owning PDF, not an equal path" { const duplicate_id = p.freeSlot() orelse return error.NoDuplicatePdfSlot; const duplicate = try panes.Pdf.openPane(p, duplicate_id, path, 0); - p.placeDoc(0, duplicate_id, duplicate); + pardes.exec.placeDoc(p, 0, duplicate_id, duplicate); layout.compute(p); panes.Pdf.openSections(p, duplicate_id); const duplicate_output_id = duplicate.search_pane orelse return error.MissingDuplicatePdfSections; -- cgit v1.3