diff options
Diffstat (limited to 'core/jj.zig')
| -rw-r--r-- | core/jj.zig | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/core/jj.zig b/core/jj.zig index 7f1e5623..dea0236f 100644 --- a/core/jj.zig +++ b/core/jj.zig @@ -2536,7 +2536,7 @@ const Repo = struct { fn told(p: *Pardes, id: usize) []const u8 { const pane = p.panes[id].?; - return pane.msg[0..pane.msg_len]; + return p.messages.saidBy(pane); } test "At shows a file at a revision beside it, read-only, coloured as its file; a Look at path@rev:line goes to it; At in it turns it in place; jj's refusals are said" { @@ -2545,6 +2545,8 @@ test "At shows a file at a revision beside it, read-only, coloured as its file; defer repo.deinit(gpa); const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 100, .rows = 40 }); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; var line: [4200]u8 = undefined; p.update(.{ .command = try std.fmt.bufPrint(&line, "Look {s}", .{repo.file}) }); const file = p.view().active; @@ -2966,6 +2968,8 @@ test "Changes draws what the text has not where it stood, as ghost rows: a line for ([_]bool{ false, true }) |windowed| { const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 60, .rows = 24, .windowed = windowed }); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; var line: [4200]u8 = undefined; p.update(.{ .command = try std.fmt.bufPrint(&line, "Look {s}", .{repo.file}) }); const id = p.view().active; @@ -3252,6 +3256,8 @@ test "a description is whole, its title and its author never cut: in a pane narr for ([_]bool{ false, true }) |windowed| { const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 50, .rows = 20, .windowed = windowed }); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; var line: [4200]u8 = undefined; p.update(.{ .command = try std.fmt.bufPrint(&line, "Look {s}", .{repo.file}) }); const id = p.view().active; @@ -3489,6 +3495,8 @@ test "at one place a change's ghost rows come before its description: a line it defer repo.deinit(gpa); const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 60, .rows = 24, .windowed = false }); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; var line: [4200]u8 = undefined; p.update(.{ .command = try std.fmt.bufPrint(&line, "Look {s}", .{repo.file}) }); const pane = p.panes[p.view().active].?; @@ -3515,6 +3523,8 @@ test "a change the revset does not pin, between two it does, moves the older one defer repo.deinit(gpa); const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 60, .rows = 24, .windowed = false }); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; var line: [4200]u8 = undefined; p.update(.{ .command = try std.fmt.bufPrint(&line, "Look {s}", .{repo.file}) }); const pane = p.panes[p.view().active].?; @@ -3607,6 +3617,8 @@ test "the layer's lines are the pane's text, read-only: j and k go onto them, a // query however long the test's directory makes the tags. const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 60, .rows = 44, .windowed = windowed }); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; var arena: std.heap.ArenaAllocator = .init(gpa); defer arena.deinit(); const pane = try Lines.open(p, repo.file); @@ -3658,8 +3670,7 @@ test "the layer's lines are the pane's text, read-only: j and k go onto them, a // the path there opens it (no selection held: B2 in one runs it). // (The refusals' words, stacked in the notice band over the body's // first rows, gone.) - pane.msg_len = 0; - pane.msg_older_len = 0; + p.messages.live_len = 0; p.view().active = id; Lines.at(pane, 0, 0); p.sync(); @@ -4407,6 +4418,8 @@ test "Compare pins the whole difference between each two points as one change: t for ([_]bool{ false, true }) |windowed| { const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 70, .rows = 24, .windowed = windowed }); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; var line: [4200]u8 = undefined; p.update(.{ .command = try std.fmt.bufPrint(&line, "Look {s}", .{repo.file}) }); const id = p.view().active; |
