summaryrefslogtreecommitdiff
path: root/src/Output.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-27 22:30:58 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit52049344c1992850ea712e029eb5c4a88a7dfe19 (patch)
tree24d12755e9545470dda8021542299f0f72fd0baf /src/Output.zig
parent82551f77833a09b313bd3e58371582abd1aedcc4 (diff)
downloadpardes-52049344c1992850ea712e029eb5c4a88a7dfe19.tar.gz
pardes-52049344c1992850ea712e029eb5c4a88a7dfe19.zip
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 <[email protected]>
Diffstat (limited to 'src/Output.zig')
-rw-r--r--src/Output.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Output.zig b/src/Output.zig
index 674fcbc8..b216c0cf 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -3,6 +3,7 @@
const panes = @import("panes.zig");
const std = @import("std");
const pardes = @import("pardes.zig");
+const exec = @import("exec.zig");
const Messages = @import("Messages.zig");
const config = @import("config.zig");
const Pardes = pardes.Pardes;
@@ -479,7 +480,7 @@ pub fn fillResults(p: *Pardes, id: usize, dir: []const u8, from: Origin, arg: []
const free = p.freeSlot() orelse return error.NoPaneSlots;
const np = try open(p, free, dir, from, arg, result_content);
np.file.?.location_rows = result_rows;
- p.placeDoc(id, free, np);
+ exec.placeDoc(p, id, free, np);
p.active = id;
if (traits(from).steps) {
pane.search_pane = free;
@@ -559,7 +560,7 @@ fn openStepped(p: *Pardes, id: usize, from: Origin, content: []u8) !void {
const dir = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice();
const free = p.freeSlot() orelse return error.NoPaneSlots;
const np = try open(p, free, dir, from, "", content);
- p.placeDoc(id, free, np);
+ exec.placeDoc(p, id, free, np);
p.active = id;
pane.search_pane = free;
pane.search_row = null;
@@ -778,6 +779,6 @@ fn openRead(p: *Pardes, id: usize, from: Origin, arg: []const u8, content: []u8)
const dir = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice();
const free = p.freeSlot() orelse return error.NoPaneSlots;
const np = try open(p, free, dir, from, arg, content);
- p.placeDoc(id, free, np);
+ exec.placeDoc(p, id, free, np);
p.active = free;
}