diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 20:41:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 22:07:55 -0300 |
| commit | 4c3dbce20f11204f6d4bfb715239beae74259e7f (patch) | |
| tree | 7cc261bdf39843b347b1b1c27829795b2e216774 /src/Query.zig | |
| parent | 50914b0e04ac0129b11bff0f0007d5cedbfc7f8d (diff) | |
| download | pardes-4c3dbce20f11204f6d4bfb715239beae74259e7f.tar.gz pardes-4c3dbce20f11204f6d4bfb715239beae74259e7f.zip | |
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Query.zig')
| -rw-r--r-- | src/Query.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Query.zig b/src/Query.zig index 7347b21c..9865001b 100644 --- a/src/Query.zig +++ b/src/Query.zig @@ -1422,7 +1422,7 @@ fn makeListRows(p: *Pardes, id: usize, pat: []const u8) !void { const owner = p.panes[oid].?; // Current: the first place after where it was asked (the answer // may come after the cursor moved), shown in the owner. - const asked_at: usize = if (p.lsp_last) |last| (if (last.serial == owner.serial) last.offset else owner.places.origin(owner)) else owner.places.origin(owner); + const asked_at: usize = if (p.lsp_ask.last) |last| (if (last.serial == owner.serial) last.offset else owner.places.origin(owner)) else owner.places.origin(owner); const hits = owner.places.hits.items; var next: ?usize = null; for (hits, 0..) |h, i| if (h.start > asked_at) { @@ -1814,7 +1814,7 @@ pub fn land(p: *Pardes, id: usize, row: ?usize) void { p.registers.last_search = '/'; set.provenance = .search; } - p.jump_force = true; + p.jumps.force = true; p.active = oid; return; } @@ -1829,7 +1829,7 @@ pub fn land(p: *Pardes, id: usize, row: ?usize) void { }; const it = q.items.items[c]; const meta = f.location_rows[c + 1]; - p.jump_force = true; + p.jumps.force = true; if (it.serial != 0) { if (p.paneBySerial(it.serial)) |tid| { p.active = tid; @@ -2323,7 +2323,7 @@ fn leader(p: *Pardes, keys: []const u8) void { fn settle(p: *Pardes) void { // a typed Grep's pause run out on the clock - p.advance(p.now_ns + Stream.debounce_ns + std.time.ns_per_ms); + p.advance(p.clock.now_ns + Stream.debounce_ns + std.time.ns_per_ms); var frames: usize = 0; while (busy(p) and frames < 2000) : (frames += 1) p.update(.tick); p.update(.tick); @@ -2492,7 +2492,7 @@ test "a language server's list: one answer lands with no pane, several open the }.of; // One: the keyboard on it, no pane, the place tinted and n's. p.lspRequest(0, .references, ""); - p.update(.{ .lsp_resp = .{ .id = p.lsp_wait.?.id, .rows = "/test.txt:3:1-5 alpha two\n" } }); + p.update(.{ .lsp_resp = .{ .id = p.lsp_ask.wait.?.id, .rows = "/test.txt:3:1-5 alpha two\n" } }); try std.testing.expectEqual(@as(usize, 1), npanes(p)); try std.testing.expectEqual(@as(usize, 0), p.active); try std.testing.expectEqual(@as(i32, 2), pane.body.cur_row); @@ -2500,7 +2500,7 @@ test "a language server's list: one answer lands with no pane, several open the try std.testing.expectEqual(Places.Hit{ .start = 15, .end = 20 }, pane.places.hits.items[0]); // None: a message, no pane. p.lspRequest(0, .diagnostics, ""); - p.update(.{ .lsp_resp = .{ .id = p.lsp_wait.?.id, .rows = "" } }); + p.update(.{ .lsp_resp = .{ .id = p.lsp_ask.wait.?.id, .rows = "" } }); try std.testing.expectEqual(@as(usize, 1), npanes(p)); try std.testing.expect(std.mem.indexOf(u8, pane.msg[0..pane.msg_len], "none") != null); // Several: the list open, the keyboard in it in normal mode on the @@ -2508,7 +2508,7 @@ test "a language server's list: one answer lands with no pane, several open the pane.body.cur_row = 0; pane.body.cur_col = 0; p.lspRequest(0, .references, ""); - p.update(.{ .lsp_resp = .{ .id = p.lsp_wait.?.id, .rows = "/test.txt:1:1-5 alpha one\n/test.txt:3:1-5 alpha two\n/test.txt:5:1-5 alpha three\n" } }); + p.update(.{ .lsp_resp = .{ .id = p.lsp_ask.wait.?.id, .rows = "/test.txt:1:1-5 alpha one\n/test.txt:3:1-5 alpha two\n/test.txt:5:1-5 alpha three\n" } }); const qid = queryPane(p).?; const qp = p.panes[qid].?; const q = qp.query.?; |
