From 5b135dc60d4e9f77be0a4f883439f3200ac30d30 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 20:53:34 -0300 Subject: fields #40, a key prefix is one enum: leader_on and ctrl_w_pending, never both, are the session's prefix (none, leader or window); handleKey's three writes of both are one each, and the reads say p.prefix == .leader (Messages.zig, normal.zig, pdf_view.zig, config.zig's test; gui.zig's leader chip on a test step); views.zig's per-view fields name prefix; a dump written before this change loads it as the default once: an Upgrade or Restore from it comes back with no prefix pending, 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/Messages.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Messages.zig') diff --git a/src/Messages.zig b/src/Messages.zig index fbcc0343..8eb18f1d 100644 --- a/src/Messages.zig +++ b/src/Messages.zig @@ -522,7 +522,7 @@ fn collectBands(p: *Pardes, pane: *Pane, r: Rect, id: usize) void { // new one lands under them; when rows run out the oldest go first. for (pane.msg_older[0..pane.msg_older_len], 0..) |line, i| pane.notices.pushAt(.older, @intCast(i), line.slot); if (pane.msg_len > 0) pane.notices.pushAt(.message, 0, pane.msg_slot); - if (id == p.active and p.leader_on) pane.notices.push(.leader); + if (id == p.active and p.prefix == .leader) pane.notices.push(.leader); // Del's question shows once its delay is up: answered before that, it // was never there. const del_waiting = pane.prompt == .del_side and pane.question_due_ns > p.clock.now_ns; @@ -836,7 +836,7 @@ test "notices stack over the body's top rows without moving them" { // A message and a leader prefix at once: two chips, in the order // collectNotices chose, each one row tall and each one row further down. try std.testing.expect(p.executeBuiltinLine(id, "Msg first")); - p.leader_on = true; + p.prefix = .leader; p.leader_n = 0; _ = frame.reset(.retain_capacity); _ = try p.render(frame.allocator()); @@ -861,7 +861,7 @@ test "notices stack over the body's top rows without moving them" { try std.testing.expect(pane.notices.left[0] < pane.notices.left[1]); // Gone with the notices: no stale chip left behind. - p.leader_on = false; + p.prefix = .none; pane.msg_len = 0; _ = frame.reset(.retain_capacity); _ = try p.render(frame.allocator()); -- cgit v1.3