diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-18 23:49:29 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 01:35:13 -0300 |
| commit | 1ca3e68f38385952fa5a2ccc3dac883ba0be71e8 (patch) | |
| tree | bffbbf9e5e5b2b929d79bd81ea805c5288896623 /core/Query.zig | |
| parent | e567aadc19f58b1e36098388483294321f3502dd (diff) | |
| download | pardes-1ca3e68f38385952fa5a2ccc3dac883ba0be71e8.tar.gz pardes-1ca3e68f38385952fa5a2ccc3dac883ba0be71e8.zip | |
core: nothing of a core is a process global, the three that were (pardes-probes P3, the reorganisation's 12c): config.tab_now goes, a tab's width is the core's settings.tab handed to every width function as `tab` (File.graphemeDisplayWidth and the 73 functions above it, test helpers among them, that had no core to read it from gained the parameter; an Editor, a Surface and the hunks' Ctx carry it; render sets Surface.tab; graphemeDisplayWidth asks its one printable ASCII byte before the tab, the two disjoint: with the tab first, as before, the parameter cost 0.2-1.7% instructions an operation in pardes-perf, with ASCII first the measured cells use 2-16% fewer than the base), so a rollback can no longer leave a stale width and replica.zig's hand-made put-back in toConfirmed goes; Addon.distrusted/ndistrusted become Addon.Distrusted, the client's own list, which its frontend owns across its joins and hands each core as Options.distrusted (in no tape, dump or digest: Options' replica .local); Kind.draw_tokens becomes each slot's `draws` (local: a draw is a frame's, so each process's count differs and no digest may hold it; the copy saves it with the slot); the two turn reads in a step stay, being shown unable to reach a client's state (the report); the soak's Proc keeps only the client's list (its tab_now and the global swaps go, forced); test/perf.zig follows three signatures, so unit-test's perf check now says BaselineHarnessMismatch until the baselines are recorded again; tui core-test 824/966 (142 skipped), shell-test 1001/1004, pane-test 183/184, behaviour-test 274/274 and --replay 274/274, process-test 2 of 144 failed (lspcomplete, lspcompletemoved), replicas --clients 5 diverged 0 unequal 0 deltas wrong 0 quiet differ 0 at 30/80/207 ms, gui unit-test 1598/1602, lib-test, daemon.py plain, --far, --games, --window-clients pass
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Query.zig')
| -rw-r--r-- | core/Query.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/Query.zig b/core/Query.zig index 870f630a..615919c1 100644 --- a/core/Query.zig +++ b/core/Query.zig @@ -406,7 +406,7 @@ fn clearPlaces(p: *Pardes, serial: u32, owner_id: ?usize) void { for (p.panes, 0..) |slot, i| { const tp = slot orelse continue; if (tp.places.from != serial) continue; - if (owner_id != null and owner_id.? == i) tp.places.restore(tp); + if (owner_id != null and owner_id.? == i) tp.places.restore(p.settings.tab, tp); tp.places.clear(p.gpa); } } @@ -593,7 +593,7 @@ fn produce(p: *Pardes, id: usize, tick: bool, keyed: bool) void { if (changed) { if (a.pat.len == 0) { if (set.from == rp.serial) set.clear(p.gpa); - set.restore(owner); + set.restore(p.settings.tab, owner); } else set.search(p, owner, .typed, rp.serial, a.pat, false, set.origin(owner), p.view().active == id); } // The owner edited: its places shifted at once; the rows follow @@ -1428,7 +1428,7 @@ fn makeListRows(p: *Pardes, id: usize, pat: []const u8) !void { }; if (next == null and hits.len > 0) next = 0; if (next) |hi| { - owner.places.goTo(owner, hi, false); + owner.places.goTo(p.settings.tab, owner, hi, false); for (q.items.items, 0..) |it, i| if (it.kind == .hit and i + 1 < rp.file.?.location_rows.len) { const meta = rp.file.?.location_rows[i + 1]; if (!std.mem.eql(u8, meta.path, owner_path)) continue; @@ -1586,7 +1586,7 @@ fn showTarget(p: *Pardes, id: usize) void { const tid = p.paneBySerial(it.serial) orelse return; const tp = p.panes[tid].?; if (tp.places.snap.len == 0) tp.places.remember(p, tp); - if (placeOnLine(p, tp, meta.at.line)) |hi| tp.places.goTo(tp, hi, false); + if (placeOnLine(p, tp, meta.at.line)) |hi| tp.places.goTo(p.settings.tab, tp, hi, false); return; } if (q.source == .symbols) { @@ -1621,7 +1621,7 @@ fn selectPlace(p: *Pardes, tp: *Pane, serial: u32, at: look.Spot) bool { const ls = File.lineStart(p.gpa, f, at.line - 1); const i = Places.firstFrom(set.hits.items, ls + (at.col -| 1)); if (i >= set.hits.items.len or (at.line < File.nlines(p.gpa, f) and set.hits.items[i].start >= File.lineStart(p.gpa, f, at.line))) return false; - set.goTo(tp, i, false); + set.goTo(p.settings.tab, tp, i, false); return true; } @@ -1876,7 +1876,7 @@ pub fn cancel(p: *Pardes, id: usize) void { const owner_id = p.paneBySerial(q.owner); for (p.panes) |slot| if (slot) |tp| { if (tp.places.from != rp.serial and tp.serial != q.owner) continue; - tp.places.restore(tp); + tp.places.restore(p.settings.tab, tp); tp.places.forget(p.gpa); if (tp.places.from == rp.serial) tp.places.clear(p.gpa); }; @@ -2074,7 +2074,7 @@ pub fn paintMark(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: u const col = File.gutterWidth(pane); var row: i32 = 0; while (row < body_h) : (row += 1) { - if (pane.wrapAt(row).line != @as(i32, @intCast(c + 1)) or col >= tw) continue; + if (pane.wrapAt(p.settings.tab, row).line != @as(i32, @intCast(c + 1)) or col >= tw) continue; s.tint(tx + col, p.bodyTop(pane, r) + @as(u16, @intCast(row)), tw - col, mark, null); } } @@ -2091,7 +2091,7 @@ pub fn paint(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, body_h: u16) var vr: i32 = 0; var last: i32 = -1; while (vr < body_h) : (vr += 1) { - const row = pane.wrapAt(vr).line; + const row = pane.wrapAt(p.settings.tab, vr).line; if (row == last or row < 1) continue; last = row; const i: usize = @intCast(row - 1); |
