summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pardes.zig5
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 },