summaryrefslogtreecommitdiff
path: root/src/layout.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout.zig')
-rw-r--r--src/layout.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/layout.zig b/src/layout.zig
index 54b89081..8e44f1d9 100644
--- a/src/layout.zig
+++ b/src/layout.zig
@@ -1,5 +1,6 @@
const std = @import("std");
const pardes = @import("pardes.zig");
+const tagline = @import("tagline.zig");
const dump = @import("dump.zig");
const config = @import("config.zig");
const panes = @import("panes.zig");
@@ -934,7 +935,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();
+ 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);
var j = c;
@@ -955,7 +956,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();
+ tagline.exitHeader(p);
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];
@@ -1010,7 +1011,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();
+ tagline.exitHeader(p);
var j = p.ncol;
while (j > c) : (j -= 1) {
p.col_panes[j] = p.col_panes[j - 1];
@@ -2262,7 +2263,7 @@ test "column reorder moves only crossed state and preserves weights" {
try std.testing.expectEqual(original_weights[2], p.col_weight[1]);
try std.testing.expectEqual(@as(u32, 11), p.col_serial[3]);
try std.testing.expectEqual(@as(?usize, 3), p.header_column);
- try std.testing.expectEqual(@as(i32, 21), p.focusedHeader().?.cur_col);
+ try std.testing.expectEqual(@as(i32, 21), tagline.focusedHeader(p).?.cur_col);
try std.testing.expectEqual(@as(usize, 9), p.header_scroll);
try std.testing.expectEqual(outer_x, p.col_x[0]);
try std.testing.expectEqual(outer_w, p.col_w[0]);