summaryrefslogtreecommitdiff
path: root/core/Jump.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-23 09:33:05 -0300
committerGabriel Schneider <[email protected]>2026-11-23 10:04:29 -0300
commit339ebde8df16f79197c2fd469eedba5edec750c4 (patch)
tree6c481746eb1e8e9830b1e96192491ea3ce6bc1bd /core/Jump.zig
parent37cc3104fe589ec7cd2a8a5dd398f0f89f412837 (diff)
downloadpardes-339ebde8df16f79197c2fd469eedba5edec750c4.tar.gz
pardes-339ebde8df16f79197c2fd469eedba5edec750c4.zip
jump, walk: two jump entries in a row are one when the digest sees them the same (`walk.eql`: the digest of each, so what the walk leaves out, a Buf's bytes past its length, a cache, decides nothing), not by std.meta.eql's every byte: core/Jump.zig:207 took the dedupe on a text entry's `place` bytes, undefined (`.place = .{}`), the same 0xAA on every Debug process and each process's own on a release build, so a session and its client kept different jump lists and the client parted (both release soaks of the base, the witness naming `views[3].jumps`, `views[0].jumps`); the test of the change before passes (Debug)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Jump.zig')
-rw-r--r--core/Jump.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/Jump.zig b/core/Jump.zig
index 66d0ba51..d85ff75a 100644
--- a/core/Jump.zig
+++ b/core/Jump.zig
@@ -203,8 +203,9 @@ pub fn trackJump(p: *Pardes) void {
};
}
// Two in a row the same (a closed one reopened beside its own,
- // or the entry between them gone): one entry, one step.
- if (w > 0 and std.meta.eql(v.jumps.list[w - 1], kept)) {
+ // or the entry between them gone): one entry, one step; the same
+ // as the digest sees them (a text's `place` is bytes undefined).
+ if (w > 0 and pardes.walk.eql(Loc, &v.jumps.list[w - 1], &kept)) {
if (i == v.jumps.cur) cur = w - 1;
continue;
}
@@ -361,7 +362,7 @@ test "the jump list never holds two entries in a row the same, when the one betw
p.view().jumps.cur = 3;
pane.body.cur_row = 80; // where you are now: far from both
trackJump(p);
- for (1..p.view().jumps.n) |i| try std.testing.expect(!std.meta.eql(p.view().jumps.list[i - 1], p.view().jumps.list[i]));
+ for (1..p.view().jumps.n) |i| try std.testing.expect(!pardes.walk.eql(Loc, &p.view().jumps.list[i - 1], &p.view().jumps.list[i]));
try std.testing.expectEqual(@as(usize, 3), p.view().jumps.n);
try std.testing.expectEqual(@as(u32, 1), p.view().jumps.list[0].line);
try std.testing.expectEqual(@as(u32, 150), p.view().jumps.list[1].line);