From 80d47cd246f37356fd2e705495936f6546613e29 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 20:47:45 -0300 Subject: fields #39, a header's focus is one optional union: header_focus and header_column, of which (false, some column) never happened, are the session's header: ?Header, workspace or column, and p.headerColumn() the column whose tag has the keyboard (null for none or the workspace's); tagline.enterHeader and exitHeader set it in one write each, layout.reorderColumn moves the focused column's index in place, and the reads in 17 files say p.header != null where they said header_focus; views.zig's per-view fields name header; a dump written before this change loads it as the default once: an Upgrade or Restore from it comes back with the keyboard on a pane, not a header, and the wire's semantics change; gates on tui: core-test 960/960, behaviour-test 238/238, pane-test 171/172 (1 skipped), snap all 108 scripts ok; gui unit-test 1518/1519 (1 skipped) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/builtins.zig | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index a924396d..7a9c2df1 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -1744,8 +1744,8 @@ pub const Panes = struct { /// Move the keyboard to the pane, or column tag, to the left. pub const Left = struct { pub fn run(c: Ctx) void { - if (c.p.header_focus) { - if (c.p.header_column) |column| if (column > 0) tagline.enterHeader(c.p, column - 1); + if (c.p.header != null) { + if (c.p.headerColumn()) |column| if (column > 0) tagline.enterHeader(c.p, column - 1); return; } _ = layout.focusDir(c.p, c.id, .left); @@ -1755,12 +1755,12 @@ pub const Left = struct { /// Move the keyboard to the pane below, off a tag onto the pane under it. pub const Down = struct { pub fn run(c: Ctx) void { - if (c.p.header_focus) { + if (c.p.header != null) { const column = layout.findPane(c.p, c.id); - if (c.p.header_column == null and layout.columnBarHeight(c.p) > 0) + if (c.p.headerColumn() == null and layout.columnBarHeight(c.p) > 0) return tagline.enterHeader(c.p, if (column) |at| at.col else 0); // Onto the top pane of the column the header stands over. - const col = c.p.header_column orelse if (column) |at| at.col else return; + const col = c.p.headerColumn() orelse if (column) |at| at.col else return; // An empty column's tag has nothing below it. if (col < c.p.ncol and c.p.cols[col].n == 0) return; tagline.exitHeader(c.p); @@ -1774,8 +1774,8 @@ pub const Down = struct { /// Move the keyboard to the pane above, and from a column's top pane to its tag. pub const Up = struct { pub fn run(c: Ctx) void { - if (c.p.header_focus) { - if (c.p.header_column != null and c.p.topBarHeight() > 0) tagline.enterHeader(c.p, null); + if (c.p.header != null) { + if (c.p.headerColumn() != null and c.p.topBarHeight() > 0) tagline.enterHeader(c.p, null); return; } if (layout.focusDir(c.p, c.id, .up)) return; @@ -1788,8 +1788,8 @@ pub const Up = struct { /// Move the keyboard to the pane, or column tag, to the right. pub const Right = struct { pub fn run(c: Ctx) void { - if (c.p.header_focus) { - if (c.p.header_column) |column| if (column + 1 < c.p.ncol) tagline.enterHeader(c.p, column + 1); + if (c.p.header != null) { + if (c.p.headerColumn()) |column| if (column + 1 < c.p.ncol) tagline.enterHeader(c.p, column + 1); return; } _ = layout.focusDir(c.p, c.id, .right); -- cgit v1.3