diff options
Diffstat (limited to 'src/Core.zig')
| -rw-r--r-- | src/Core.zig | 9 |
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()); } |
