diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 14:12:36 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 0aea490eef4f0a9743006dd4d8d6e1ac4324bafe (patch) | |
| tree | 0ff784b65c031cd4a61057ad25c33c8ff3fc4bec /src/pardes.zig | |
| parent | b14f7102620bbaa999472e48a9771052749e96e8 (diff) | |
| download | pardes-0aea490eef4f0a9743006dd4d8d6e1ac4324bafe.tar.gz pardes-0aea490eef4f0a9743006dd4d8d6e1ac4324bafe.zip | |
Back at the oldest place says nothing further back, and Forward at the newest nothing further on
A step past either end of the jumplist did nothing, silently.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 1c65795a..ec406094 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -6869,7 +6869,9 @@ pub const Pardes = struct { pub fn jumpBy(p: *Pardes, delta: i32) void { const next = @as(i64, @intCast(p.jcur)) + delta; - if (p.njumps == 0 or next < 0 or next >= p.njumps) return; + // At an end of the list: said, not a step that silently does nothing. + if (p.njumps == 0 or next < 0 or next >= p.njumps) + return p.setMessage(p.active, if (delta < 0) "Back: nothing further back" else "Forward: nothing further on"); const j = p.jumps[@intCast(next)]; if (j.pane >= MAX_PANES) return; // A closed file's entry: opened again at its dot, placed as a look @@ -8404,6 +8406,7 @@ test "jump history clears selections and lands at the recorded cursor" { const selected = pane.body.primaryRange(pane.file.?.content, 0); p.jumpBy(1); // No forward entry: selection stays untouched. try std.testing.expectEqualDeep(selected, pane.body.primaryRange(pane.file.?.content, 0)); + try std.testing.expect(std.mem.indexOf(u8, p.panes[p.active].?.msg[0..p.panes[p.active].?.msg_len], "nothing further on") != null); for ([_]Loc{ .{ .pane = 15, .serial = pane.serial, .line = 1, .col = 1 }, .{ .pane = 0, .serial = pane.serial + 1, .line = 1, .col = 1 }, |
