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/gui/gui.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui') diff --git a/src/gui/gui.zig b/src/gui/gui.zig index cf35a5fa..a54a4b7b 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -824,7 +824,7 @@ test "GUI completion failure survives backlog and leaves the document unchanged" const pane = try core.setTestFile("abc"); pane.body.cur_col = 1; core.lspRequest(core.active, .completion, ""); - const id = core.lsp_wait.?.id; + const id = core.lsp_ask.wait.?.id; var queue: Queue = .{ .io = std.testing.io, .gpa = gpa, .lsp_allocator = gpa, .lsp_id = id }; defer queue.deinit(); queue.acceptReader(0, 1); @@ -844,7 +844,7 @@ test "GUI completion failure survives backlog and leaves the document unchanged" shell.gens = &gens; shell.ptys = &ptys; shell.drainQueue(); - try std.testing.expect(core.lsp_wait == null); + try std.testing.expect(core.lsp_ask.wait == null); try std.testing.expectEqualStrings("abc", pane.file.?.content); try std.testing.expectEqual(@as(i32, 1), pane.body.cur_col); } @@ -899,7 +899,7 @@ test "GUI worker setup failures finish matching LSP and pipe requests" { var tasks: PipeTasks = .{}; core.lspRequest(core.active, .status, ""); const req: host_io.Lsp.Request = .{ - .id = core.lsp_wait.?.id, + .id = core.lsp_ask.wait.?.id, .kind = .status, .pane = @intCast(core.active), .offset = 0, @@ -919,7 +919,7 @@ test "GUI worker setup failures finish matching LSP and pipe requests" { shell.threads_ok = false; lsp(&shell, req); } - try std.testing.expect(core.lsp_wait == null); + try std.testing.expect(core.lsp_ask.wait == null); try std.testing.expectEqualStrings("abc", pane.file.?.content); pane.body.cur_col = 2; @@ -4133,7 +4133,7 @@ fn guiNow(ctx: ?*anyopaque) u64 { const s = shellOf(ctx); if (s.waited) { s.waited = false; - if (s.mail_only and s.peers.count() > 0 and s.core.clock_started) return s.core.now_ns; + if (s.mail_only and s.peers.count() > 0 and s.core.clock.started) return s.core.clock.now_ns; } return s.test_clock orelse s.paced_ns orelse c.SDL_GetTicksNS(); } @@ -4797,7 +4797,7 @@ const GlideRun = struct { frames: usize = 0, fn play(seq: *GlideRun, g: *Gui, core: *pardes.Pardes, gpa: std.mem.Allocator, arena: *std.heap.ArenaAllocator, script: []const Step, frames: usize) !void { - var now: u64 = core.now_ns; + var now: u64 = core.clock.now_ns; var next: usize = 0; for (0..frames) |frame| { while (next < script.len and script[next].frame == frame) : (next += 1) core.update(.{ .key = script[next].key }); -- cgit v1.3