summaryrefslogtreecommitdiff
path: root/src/Core.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 01:42:25 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commitb3d32656413734952bc918c2d4cfd12fede6c214 (patch)
tree04386fab10b9ed803ec31251cb733cc32852390a /src/Core.zig
parent4a33b8d2bd409d4a06205f28e0eb1b4cdaf49889 (diff)
parente6e81a6bc544c5ab5a47c21d85e6868020031abb (diff)
downloadpardes-b3d32656413734952bc918c2d4cfd12fede6c214.tar.gz
pardes-b3d32656413734952bc918c2d4cfd12fede6c214.zip
integration: the diff viewer on general mechanisms, and the plumber's first phase, together
A merge of diff-lib and plumber-1; the changelog keeps both sides' entries; core-test 984/984 on tui, the process suite's tree cases pass (fs-help.txt holds both the rows and the plumb lines in its 45). Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/Core.zig')
-rw-r--r--src/Core.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Core.zig b/src/Core.zig
index c5187616..9a6e80d4 100644
--- a/src/Core.zig
+++ b/src/Core.zig
@@ -39,6 +39,7 @@ const Rect = pardes.Rect;
const Registers = pardes.Registers;
const RowMetrics = pardes.RowMetrics;
const Store = @import("Store.zig");
+const Plumb = @import("Plumb.zig");
const Db = pardes.Db;
const Stream = pardes.Stream;
const Surface = pardes.Surface;
@@ -211,6 +212,9 @@ incl: std.ArrayList([]u8) = .empty,
/// Plumb's rules, the user's, tried in order before the built-in ones
/// (look.resolve), the first to match taking the look. Kept in a dump.
plumb: std.ArrayList([]u8) = .empty,
+/// The plumber's rules (Plumb.zig): plumb/rules and plumb/send's, the
+/// defaults (`include basic`) until something writes others. Kept in a dump.
+plumber: Plumb = .{},
/// Zerox's groups of panes on one buffer (File.syncTwins), and the id
/// the next takes.
twin_groups: std.ArrayList(pardes.panes.File.TwinGroup) = .empty,
@@ -227,6 +231,9 @@ next_serial: u32 = 0,
/// The column whose tag the running command came from, while it runs:
/// the column acme's commands take from their Text's col.
exec_column: ?usize = null,
+/// The directory a `plumb start`'s command runs in, while it runs
+/// (Plumb.run): the message's wdir, which no pane need have.
+exec_dir: ?[]const u8 = null,
/// Panes made this step that found no room in their column
/// (layout.placeNew): closed at the step's end, once whatever made them
/// is done with them.
@@ -759,6 +766,7 @@ pub fn deinit(p: *Pardes) void {
p.incl.deinit(p.gpa);
for (p.plumb.items) |rule| p.gpa.free(rule);
p.plumb.deinit(p.gpa);
+ p.plumber.deinit(p.gpa);
for (p.twin_groups.items) |group| p.gpa.free(group.path);
p.twin_groups.deinit(p.gpa);
p.fs.batch.bytes.deinit(p.gpa);
@@ -1703,6 +1711,7 @@ fn processDir(buf: *[limits.host_path_cap]u8) ?[]const u8 {
/// The directory a word run from pane `id`'s text or tag runs in, or,
/// from a header, the session's.
pub fn execDir(p: *Pardes, id: usize) []const u8 {
+ if (p.exec_dir) |dir| return dir;
if (p.exec_header) return p.sessionDir();
return paneDir(p.panes[id] orelse return p.sessionDir());
}