summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 20:47:45 -0300
committerGabriel Schneider <[email protected]>2026-11-05 22:07:55 -0300
commit80d47cd246f37356fd2e705495936f6546613e29 (patch)
treec9b8025faa82717c9cc51d98dd4ce774dc0fad13 /src/ninep
parent4c3dbce20f11204f6d4bfb715239beae74259e7f (diff)
downloadpardes-80d47cd246f37356fd2e705495936f6546613e29.tar.gz
pardes-80d47cd246f37356fd2e705495936f6546613e29.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/cols.zig2
-rw-r--r--src/ninep/ctl.zig4
-rw-r--r--src/ninep/tree.zig2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig
index 3a7f0dbb..20ee2e3e 100644
--- a/src/ninep/cols.zig
+++ b/src/ninep/cols.zig
@@ -20,7 +20,7 @@ const E = tree.E;
/// else the active pane's. Null when the workspace tag has it and no pane
/// is active.
pub fn activeColumn(p: *const Pardes) ?usize {
- if (p.header_focus) if (p.header_column) |c| return if (c < p.ncol) c else null;
+ if (p.headerColumn()) |c| return if (c < p.ncol) c else null;
const at = layout.findPane(p, p.active) orelse return null;
return at.col;
}
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 04ac1cbf..9c5b82bf 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -431,7 +431,7 @@ pub fn paneText(p: *Pardes, pane: *Pane, buf: []u8) []const u8 {
const font = p.settings.font.effective_name.get();
writeQuoted(&w, if (font.len == 0) "default" else font) catch return w.buffered();
// While a column's or the workspace's tag has the keyboard, no pane does.
- const current = p.panes[p.active] == pane and !p.header_focus;
+ const current = p.panes[p.active] == pane and p.header == null;
const f = pane_files.fileOf(pane);
const undo = if (f) |file| file.history.journal.done > 0 else false;
const redo = if (f) |file| file.history.journal.done < file.history.journal.steps.items.len else false;
@@ -909,7 +909,7 @@ pub fn commandsText(p: *Pardes) ![]const u8 {
/// rio keeps `current` apart from `unhide`.
pub fn readFocus(p: *Pardes, req: Req) Reply {
const out = p.fs.stage(p.gpa);
- if (p.header_focus) return tree.stagedReply(p, req);
+ if (p.header != null) return tree.stagedReply(p, req);
const pane = p.panes[p.active] orelse return tree.stagedReply(p, req);
out.print(p.gpa, "{d}\n", .{pane.serial}) catch return Reply.fail(req.tag, E.NOMEM);
return tree.stagedReply(p, req);
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig
index 08db0d75..a00a8947 100644
--- a/src/ninep/tree.zig
+++ b/src/ninep/tree.zig
@@ -686,7 +686,7 @@ fn topSize(p: *Pardes, f: TopFile) u64 {
.ctl => if (ctl.settingsText(p)) |text| text.len else |_| 0,
.commands => if (ctl.commandsText(p)) |text| text.len else |_| 0,
.focus => focus: {
- if (p.header_focus) break :focus 0;
+ if (p.header != null) break :focus 0;
const pn = p.panes[p.active] orelse break :focus 0;
var digits: [16]u8 = undefined;
// unreachable: a u32 serial and a newline fit 16