summaryrefslogtreecommitdiff
path: root/core/Trail.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Trail.zig')
-rw-r--r--core/Trail.zig12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/Trail.zig b/core/Trail.zig
index cd8eb924..e42ab1e2 100644
--- a/core/Trail.zig
+++ b/core/Trail.zig
@@ -250,7 +250,9 @@ fn show(p: *Pardes, id: usize, path: []const u8, at: Spot) !usize {
.opened => |free| free,
.shown, .none => return p.view().active,
};
- if (at.line > panes.File.nlines(p.gpa, &p.panes[free].?.file.?)) {
+ // (A kind's pane, look.open's for a file a kind takes, has no lines.)
+ const nf = if (p.panes[free].?.file) |*f| f else return free;
+ if (at.line > panes.File.nlines(p.gpa, nf)) {
try p.removePane(free, null);
p.view().active = id;
return error.LineMissing;
@@ -712,7 +714,7 @@ test "a file's pane is reading, its tag in the reading tint with Keep after its
// Under Jumps new-pane nothing reads: the tag as it always was.
p.settings.jumps = .@"new-pane";
try std.testing.expect(!reading(p, pane));
- try std.testing.expectEqualStrings("/test.txt Save Term Collapse Follow Del", try tagOf(p, pane));
+ try std.testing.expectEqualStrings("/test.txt Del ", try tagOf(p, pane));
try std.testing.expectEqual(pardes.Color{ .rgb = p.chromeTheme().tag_active_bg }, try tagGroundOf(p, &arena, 0));
p.settings.jumps = .walk;
// Typed into: held from now on, though Undo takes the text back.
@@ -764,7 +766,7 @@ const Fixture = struct {
for ([_][]const u8{ "search.zig", "rank.zig", "place.zig" }) |name|
try f.tmp.dir.writeFile(std.testing.io, .{ .sub_path = name, .data = w.buffered() });
f.dir = f.dir_buf[0..try f.tmp.dir.realPath(std.testing.io, &f.dir_buf)];
- f.p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = rows });
+ f.p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 200, .rows = rows });
errdefer f.p.deinit();
_ = try f.p.setTestFile("scratch\n");
f.p.settings.jumps = .@"new-pane";
@@ -867,7 +869,7 @@ test "a Look from inside the reader at a file its held pane shows focuses the he
test "the reader of a held pane too short to halve goes to the bottom of the next column, of the previous one from the last" {
var f: Fixture = .{ .p = undefined, .tmp = undefined };
- try f.init(24);
+ try f.init(20);
defer f.deinit();
const col = layout.findPane(f.p, f.held).?.col;
try std.testing.expect(f.p.view().rects[f.held].h / 2 < f.p.panes[f.held].?.tag_rows + layout.reader_keeps);
@@ -944,7 +946,7 @@ test "the session of pick-ui ยง6.7: four jumps across three files, back by a cli
// makes a new reader.
pardes.exec.runBuiltin(p, .Keep, r, "Keep", null);
p.sync();
- try std.testing.expect(std.mem.startsWith(u8, try tagOf(p, p.panes[r].?), try std.fmt.bufPrint(&buf, "{s}/rank.zig Save", .{f.dir})));
+ try std.testing.expect(std.mem.startsWith(u8, try tagOf(p, p.panes[r].?), try std.fmt.bufPrint(&buf, "{s}/rank.zig Del ", .{f.dir})));
f.look(f.held, "place.zig", 20);
const fresh = p.view().active;
try std.testing.expect(fresh != r and fresh != f.held and p.panes[r] != null);