summaryrefslogtreecommitdiff
path: root/src/layout.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout.zig')
-rw-r--r--src/layout.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/layout.zig b/src/layout.zig
index 6c5f4474..2df64594 100644
--- a/src/layout.zig
+++ b/src/layout.zig
@@ -777,6 +777,7 @@ pub fn removePane(p: *Pardes, id: usize) void {
while (k + 1 < p.col_n[c]) : (k += 1) p.col_panes[c][k] = p.col_panes[c][k + 1];
p.col_n[c] -= 1;
if (p.col_n[c] == 0) {
+ p.exitHeader();
if (p.ncol > 1) p.col_weight[if (c > 0) c - 1 else c + 1] +|= p.col_weight[c];
var j = c;
while (j + 1 < p.ncol) : (j += 1) {
@@ -787,7 +788,6 @@ pub fn removePane(p: *Pardes, id: usize) void {
}
p.ncol -= 1;
p.col_tags[p.ncol] = .{};
- p.topbar_col = null;
}
}
@@ -795,6 +795,7 @@ pub fn joinCol(p: *Pardes) void {
const f = findPane(p, p.active) orelse return;
const c = f.col;
if (c + 1 >= p.ncol) return;
+ p.exitHeader();
const dst = c + 1;
p.col_weight[dst] +|= p.col_weight[c];
for (0..p.col_n[c]) |k| p.col_panes[dst][p.col_n[dst] + k] = p.col_panes[c][k];
@@ -808,7 +809,6 @@ pub fn joinCol(p: *Pardes) void {
}
p.ncol -= 1;
p.col_tags[p.ncol] = .{};
- p.topbar_col = null;
}
pub fn canSplitColumn(p: *Pardes, source_id: usize) bool {
@@ -847,6 +847,7 @@ pub fn splitColumn(p: *Pardes, source_id: usize, id: usize, before: bool) bool {
const new_weight = old_weight - source_weight;
p.col_weight[source_col] = source_weight;
const c = source_col + @intFromBool(!before);
+ p.exitHeader();
var j = p.ncol;
while (j > c) : (j -= 1) {
p.col_panes[j] = p.col_panes[j - 1];
@@ -856,7 +857,6 @@ pub fn splitColumn(p: *Pardes, source_id: usize, id: usize, before: bool) bool {
}
p.col_weight[c] = new_weight;
p.col_tags[c] = .{};
- p.topbar_col = null;
p.col_panes[c][0] = id;
p.col_n[c] = 1;
p.ncol += 1;