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/keys.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/keys.zig') diff --git a/src/keys.zig b/src/keys.zig index 264eb95e..2906e870 100644 --- a/src/keys.zig +++ b/src/keys.zig @@ -143,7 +143,7 @@ pub fn answerQuestion(p: *Pardes, id: usize, choice: ?u8) bool { if (choice == 'k') exec.runBuiltin(p, .Del, id, "", "k"); if (choice == 'j') exec.runBuiltin(p, .Del, id, "", "j"); // Asked from window mode (`d`): the outline goes with the rows. - if (p.window_pick == id and p.panes[id] == null) p.window_pick = if (p.header_focus) null else p.active; + if (p.window_pick == id and p.panes[id] == null) p.window_pick = if (p.header != null) null else p.active; }, else => return false, } @@ -260,7 +260,7 @@ pub fn handleKey(p: *Pardes, key: Key) void { const nt = p.newShell(free, "") catch return; nt.greet = true; // From a tag, as a 9P new is: acme's t->w == nil. - exec.placeNew(p, p.active, if (p.header_focus) null else p.active, free, .shell); + exec.placeNew(p, p.active, if (p.header != null) null else p.active, free, .shell); return; } for (config.jump_keys) |jk| { @@ -351,7 +351,7 @@ pub fn handleKey(p: *Pardes, key: Key) void { }; const txt = shown[span[0]..span[1]]; // A column tag's command acts on that column, empty or not. - p.exec_column = if (header != null) p.header_column else null; + p.exec_column = if (header != null) p.headerColumn() else null; defer p.exec_column = null; p.exec_header = header != null; defer p.exec_header = false; @@ -796,7 +796,7 @@ test "s in a header selects in the header's own text" { // the prompt takes the keys while the header keeps the keyboard p.update(.{ .key = .{ .cp = 'c', .text = "col" } }); p.update(.{ .key = .{ .cp = Key.enter } }); - try std.testing.expect(p.header_focus and pane.prompt == .none); + try std.testing.expect(p.header != null and pane.prompt == .none); var ranges: [Text.max_selections]modal.Selection = undefined; const text = try edit.flatSurface(p, &p.global_tag); const got = p.global_tag.ranges(text, 0, &ranges); -- cgit v1.3