summaryrefslogtreecommitdiff
path: root/gui/src/Navigation.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-13 09:28:38 -0300
committerGabriel Schneider <[email protected]>2026-11-13 09:28:38 -0300
commit5c0230ea5a77f85de77ad4354788cd6c27aa1ef6 (patch)
treee01a903bdee092965b86e118dfaab85c3bd60004 /gui/src/Navigation.zig
parent5a40dca5adb6e9e650f55f3ec6f254a13bf50493 (diff)
downloadcomputeranim-5c0230ea5a77f85de77ad4354788cd6c27aa1ef6.tar.gz
computeranim-5c0230ea5a77f85de77ad4354788cd6c27aa1ef6.zip
debugger: follow natural V8 deoptimization with adaptive live views
Diffstat (limited to 'gui/src/Navigation.zig')
-rw-r--r--gui/src/Navigation.zig14
1 files changed, 12 insertions, 2 deletions
diff --git a/gui/src/Navigation.zig b/gui/src/Navigation.zig
index f9ae34a..7edd4d9 100644
--- a/gui/src/Navigation.zig
+++ b/gui/src/Navigation.zig
@@ -1,7 +1,7 @@
//! Bounded per-pane jump history. Scrolling changes the current location, not the target.
const std = @import("std");
const Navigation = @This();
-pub const Location = struct { address: u64 = 0, row: f32 = 0, follow: bool = true };
+pub const Location = struct { address: u64 = 0, row: f64 = 0, follow: bool = true, manual: bool = false };
place: Location = .{},
history: [32]Location = @splat(.{}),
len: u8 = 0,
@@ -45,7 +45,7 @@ test "pane jumps retain scroll and discard the abandoned forward branch" {
n.place.row = 3;
n.visit(0x2000);
n.back();
- try std.testing.expectEqual(@as(f32, 3), n.place.row);
+ try std.testing.expectEqual(@as(f64, 3), n.place.row);
n.visit(0x3000);
n.forward();
try std.testing.expectEqual(@as(u64, 0x3000), n.place.address);
@@ -54,3 +54,13 @@ test "pane jumps retain scroll and discard the abandoned forward branch" {
for (0..40) |_| n.back();
try std.testing.expectEqual(@as(u64, 0x4008), n.place.address);
}
+
+test "large mapping row history keeps individual words reachable" {
+ var n: Navigation = .{};
+ n.visit(0x100000000);
+ n.place.row = 268435455;
+ n.place.row -= 1;
+ n.visit(0x200000000);
+ n.back();
+ try std.testing.expectEqual(@as(f64, 268435454), n.place.row);
+}