From 64b6a0dbdaab4b314ccbce667709d71a8561daf0 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 00:01:04 -0300 Subject: The tree serves the layout: /layout, /tag and /col//tag A script could not see where the panes sit or edit the tags a person clicks in. /layout lists each column, its index, x and width in cells, current or not, empty or full, and its panes' serials, then the active column; /tag is the workspace tag and /col//tag a column's, read and written as a pane tag is (one line: a newline written in is a space, and a truncating write drops the one ending it); /index's lines end with the pane's column; the log says newcol and delcol . acme serves no column files, and the docs say so. Co-Authored-By: Claude Opus 5.5 --- src/layout.zig | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/layout.zig') diff --git a/src/layout.zig b/src/layout.zig index c58f3bcf..6de7a912 100644 --- a/src/layout.zig +++ b/src/layout.zig @@ -280,7 +280,7 @@ pub fn applyRowSplit(p: *Pardes, cc: usize, k: usize, cur_y: u16) void { b.vweight = pair - a.vweight; } -pub fn findPane(p: *Pardes, id: usize) ?struct { col: usize, idx: usize } { +pub fn findPane(p: *const Pardes, id: usize) ?struct { col: usize, idx: usize } { for (0..p.ncol) |c| { for (0..p.col_n[c]) |k| { if (p.col_panes[c][k] == id) return .{ .col = c, .idx = k }; @@ -325,6 +325,14 @@ pub fn dropColumn(p: *Pardes, c: usize) void { p.ncol -= 1; p.col_tags[p.ncol] = .{ .what = .column, .gpa = p.gpa }; p.col_serial[p.ncol] = 0; + noteColumn(p, "delcol", c); +} + +/// `newcol ` or `delcol ` in the log: the index, as /layout and +/// /col number columns, the ones after it moving up or down one. +fn noteColumn(p: *Pardes, what: []const u8, c: usize) void { + var buf: [16]u8 = undefined; + pardes.ctlfs.events.notePath(p, what, std.fmt.bufPrint(&buf, "{d}", .{c}) catch return); } /// Fold column `c` into the one on its right, its panes below theirs. @@ -480,6 +488,7 @@ pub fn insertColumn(p: *Pardes, col: usize, before: bool) ?usize { p.col_serial[c] = 0; p.col_n[c] = 0; p.ncol += 1; + noteColumn(p, "newcol", c); return c; } -- cgit v1.3