summaryrefslogtreecommitdiff
path: root/src/Core.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 02:31:20 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commitf749eb712d990a9b03f1db372d5311e77bd32edd (patch)
treeee4d9966f1eb293054b7ed865c9d4d6eb49e432b /src/Core.zig
parent8f6621f9f70db86d56266a59b56dfb92b324b0d9 (diff)
parentb3d32656413734952bc918c2d4cfd12fede6c214 (diff)
downloadpardes-f749eb712d990a9b03f1db372d5311e77bd32edd.tar.gz
pardes-f749eb712d990a9b03f1db372d5311e77bd32edd.zip
integration: the terminal behind src/Term.zig, with the diff viewer and the plumber's first phase
A merge of term-phase0 and pardes-next. File.zig's recolorSyntax keeps the theme's grounds and names Term.Filter and Term.Span; the changelog keeps both sides' entries, the palette sentence in the place of the entry the terminal work cut down. core-test 985/985 on tui; the diff, pager and tree process cases pass, goldens unchanged. 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 5516265e..7d8cfb0e 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;
@@ -210,6 +211,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,
@@ -226,6 +230,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.
@@ -758,6 +765,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);
@@ -1711,6 +1719,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());
}