summaryrefslogtreecommitdiff
path: root/src/layout.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout.zig')
-rw-r--r--src/layout.zig13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/layout.zig b/src/layout.zig
index 25c95d30..b9b24e79 100644
--- a/src/layout.zig
+++ b/src/layout.zig
@@ -322,6 +322,7 @@ pub fn removePane(p: *Pardes, id: usize) void {
/// it (the first column's to its right), as acme's rowclose gives it.
pub fn dropColumn(p: *Pardes, c: usize) void {
std.debug.assert(p.col_n[c] == 0);
+ const serial = columnSerial(p, c);
tagline.exitHeader(p);
if (p.ncol > 1) p.col_weight[if (c > 0) c - 1 else c + 1] +|= p.col_weight[c];
p.col_tags[c].deinit(p.gpa);
@@ -336,14 +337,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);
+ noteColumn(p, "delcol", serial);
}
-/// `newcol <n>` or `delcol <n>` 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 {
+/// `newcol <serial>` or `delcol <serial>` in the log: the column's serial,
+/// as /layout and /col name it.
+fn noteColumn(p: *Pardes, what: []const u8, serial: u32) void {
var buf: [16]u8 = undefined;
- pardes.ctlfs.events.notePath(p, what, std.fmt.bufPrint(&buf, "{d}", .{c}) catch return);
+ pardes.ctlfs.events.notePath(p, what, std.fmt.bufPrint(&buf, "{d}", .{serial}) catch return);
}
/// Fold column `c` into the one on its right, its panes below theirs.
@@ -499,7 +500,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);
+ noteColumn(p, "newcol", columnSerial(p, c));
return c;
}