From 4c3dbce20f11204f6d4bfb715239beae74259e7f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 20:41:32 -0300 Subject: fields #38, the jump list, the language servers' question and the core's clock are fields of their nouns: Jump.zig is the jump list's type (list, n, cur, force, its own len annotation) and the session's jumps a Jump where it was jumps, njumps, jcur and jump_force; lsp/Ask.zig is the question's (seq, last, wait) and the session's lsp_ask an Ask where it was lsp_seq, lsp_last and lsp_wait; the clock is the session's clock, a Clock (now_ns, stepped_ns, started) where it was now_ns, stepped_ns and clock_started; a view opened still starts with no query's mark on its jumps and one closed leaves the staying view's (views.zig), as when the mark was a field of its own; callers in 26 files read p.jumps.n, p.lsp_ask.wait, p.clock.now_ns (macos.zig's lsp_wait tests by text, built nowhere here; dump.zig, the persistence agent's, only where it names lsp_seq); a dump written before this change loads these as their defaults once: an Upgrade or Restore from it comes back with no jumps, no language question awaited and its clock unstarted (jumps' kind changed, so the decoder says so), 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 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/keys.zig') diff --git a/src/keys.zig b/src/keys.zig index 60e6fa0f..264eb95e 100644 --- a/src/keys.zig +++ b/src/keys.zig @@ -524,7 +524,7 @@ test "Del from a key asks which neighbour takes the rows; nothing else asks" { p.update(.{ .key = .{ .cp = 'd' } }); try std.testing.expect(p.panes[mid] != null); try std.testing.expectEqual(Pane.Prompt.del_side, p.panes[mid].?.prompt); - p.now_ns = p.panes[mid].?.question_due_ns; // shown once its delay is up + p.clock.now_ns = p.panes[mid].?.question_due_ns; // shown once its delay is up _ = try p.render(frame.allocator()); try std.testing.expectEqual(Pane.Notices.Kind.prompt, p.panes[mid].?.notices.kinds[p.panes[mid].?.notices.len - 1]); try std.testing.expectEqualStrings(config.del_question, p.panes[mid].?.promptText().?); @@ -687,9 +687,9 @@ test "the Del question shows only once its delay is up: a quick SPC d j never se p.newScratchBelow(mid); p.sync(); p.active = mid; - p.now_ns = 5 * std.time.ns_per_s; - p.stepped_ns = p.now_ns; - const asked_at = p.now_ns; + p.clock.now_ns = 5 * std.time.ns_per_s; + p.clock.stepped_ns = p.clock.now_ns; + const asked_at = p.clock.now_ns; p.update(.{ .key = .{ .cp = ' ' } }); p.update(.{ .key = .{ .cp = 'd' } }); const pane = p.panes[mid].?; @@ -701,13 +701,13 @@ test "the Del question shows only once its delay is up: a quick SPC d j never se // The loop wakes for it, at the end of the delay and not before. const wake = p.nextWake().?; try std.testing.expect(wake >= pane.question_due_ns and wake < pane.question_due_ns + frame_ns); - p.now_ns = pane.question_due_ns - 1; + p.clock.now_ns = pane.question_due_ns - 1; _ = try p.render(frame.allocator()); for (pane.notices.kinds[0..pane.notices.len]) |kind| try std.testing.expect(kind != .prompt); // Its time come, it is the band's last line; stepped past it, nothing // more to wake for. - p.now_ns = wake; - p.stepped_ns = wake; + p.clock.now_ns = wake; + p.clock.stepped_ns = wake; _ = try p.render(frame.allocator()); try std.testing.expectEqual(Pane.Notices.Kind.prompt, pane.notices.kinds[pane.notices.len - 1]); try std.testing.expect(p.nextWake() == null); -- cgit v1.3