summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 01:43:24 -0300
committerGabriel Schneider <[email protected]>2026-11-24 01:43:40 -0300
commited05c825102ebce7cd1e314226a1c88b8658baef (patch)
tree41957f9fb7c5df11389d7872079c6494f47af5ce /test/panes.zig
parent0252c830daf6184a9faefa32a7d1f384f5a86b94 (diff)
parent59b6ac1bae9cb6720252e1c3e1cc9d4f3a8ab3b1 (diff)
downloadpardes-ed05c825102ebce7cd1e314226a1c88b8658baef.tar.gz
pardes-ed05c825102ebce7cd1e314226a1c88b8658baef.zip
integration: the tree to install next: a view scrolls by ROWS: `main` (pardes-merge66, 0252c830daf6, installed 2026-11-24 01:22) and pardes-row-scroll-3 (`wkxsvmun` on `kyntorlp`, `rymstysv`, `qwssppvo`, on pardes-merge65: a view's top is (line, row within the line's own wrapped rows): a notch is one row through a wrapped line and a wrapped description of the layer, the margin, PageDown/PageUp, `gt`/`gb`, `gw`, `blankRows` and a Look's centring count rows; the wire 35); no conflict; REMOVED HERE: `core/walk.zig.orig`, a patch's leftover that `pvwuwnlk` had added; EXPECTED in its gate and ruled: corpus frame 76 differs (the margin counts rows: the new picture stands) and ten perf counts over tree7 (P85: the view now draws the rows the cursor is on in a wrapped line: deep-sel; the cursor's row found in long lines); its gate: .scratch/sketch/reorg/merge67, the numbers in PARDES.md
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig28
1 files changed, 15 insertions, 13 deletions
diff --git a/test/panes.zig b/test/panes.zig
index bd39beba..eea4b36d 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -157,7 +157,7 @@ const BodyHitTests = struct {
p.view().row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 8, .tagline_h = 10 };
const pane = try TreeContextTests.setZigFile(p, "const Box = struct {\n pub fn work(\n value: usize,\n ) void {\n" ++ std.mem.asBytes(&@as([60][16]u8, @splat(" // body\n".*))) ++ " }\n};\n");
try std.testing.expect(p.executeBuiltinLine(0, "TreeContext"));
- pane.scrollBy(10);
+ pane.scrollBy(pardes.config.tab_width, 10);
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
p.sync();
@@ -205,7 +205,7 @@ const LineNumberLookTests = struct {
p.view().row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 8, .tagline_h = 10 };
const pane = try TreeContextTests.setZigFile(p, "const Box = struct {\n pub fn work(\n value: usize,\n ) void {\n" ++ std.mem.asBytes(&@as([60][16]u8, @splat(" // body\n".*))) ++ " }\n};\n");
try std.testing.expect(p.executeBuiltinLine(0, "TreeContext"));
- pane.scrollBy(30);
+ pane.scrollBy(pardes.config.tab_width, 30);
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
p.sync();
@@ -219,7 +219,7 @@ const LineNumberLookTests = struct {
const rows = [_]u16{ 1, pane.context_rows + 3 };
for (rows) |row| {
// Each Look recentres the view; come back under the headers.
- pane.scrollBy(30 - pane.scroll());
+ pane.scrollBy(pardes.config.tab_width, 30 - pane.scroll());
_ = frame.reset(.retain_capacity);
_ = try p.render(frame.allocator());
const expected = pane.wrapAt(config.tab_width, row).line;
@@ -262,7 +262,7 @@ const TreeContextTests = struct {
const pane = try setZigFile(p, "const Box = struct {\n\n // omitted member comment\n\n pub fn work(\n value: usize,\n ) void {\n" ++ std.mem.asBytes(&@as([30][16]u8, @splat(" // body\n".*))) ++ " }\n};\n");
p.view().row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 8, .tagline_h = 10 };
try std.testing.expect(p.executeBuiltinLine(0, "TreeContext"));
- pane.scrollBy(10);
+ pane.scrollBy(pardes.config.tab_width, 10);
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
p.sync();
@@ -278,7 +278,7 @@ const TreeContextTests = struct {
// A one-pixel separator remains inside its existing header row.
try std.testing.expectEqual(row, layer.bodyHit(x, y, 10, 20, 8, 10).?.row);
}
- pane.scrollBy(-5);
+ pane.scrollBy(pardes.config.tab_width, -5);
_ = try p.render(frame.allocator());
try std.testing.expectEqual(@as(u16, 2), layer.context_rows);
try std.testing.expect(layer.hasContextBorderAfter(0));
@@ -317,7 +317,7 @@ const TreeContextTests = struct {
const pane = try setZigFile(p, source);
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
- pane.scrollBy(7);
+ pane.scrollBy(pardes.config.tab_width, 7);
p.sync();
_ = try p.render(frame.allocator());
try std.testing.expectEqual(@as(u16, 0), pane.context_rows);
@@ -348,7 +348,7 @@ const TreeContextTests = struct {
p.update(.{ .key = .{ .cp = Key.escape } });
var previous: u16 = pane.context_rows;
while (pane.scroll() > 0) {
- pane.scrollBy(-1);
+ pane.scrollBy(pardes.config.tab_width, -1);
_ = try p.render(frame.allocator());
try std.testing.expect(pane.context_rows <= previous);
previous = pane.context_rows;
@@ -357,7 +357,7 @@ const TreeContextTests = struct {
try std.testing.expectEqual(@as(u16, 0), pane.context_rows);
try std.testing.expectEqual(@as(i32, 0), pane.wrapRow(config.tab_width, 0, pane.body.cur_col).row);
try std.testing.expect(p.executeBuiltinLine(0, "TreeContext"));
- pane.scrollBy(7);
+ pane.scrollBy(pardes.config.tab_width, 7);
_ = try p.render(frame.allocator());
try std.testing.expectEqual(@as(u16, 0), pane.context_rows);
}
@@ -370,7 +370,7 @@ const TreeContextTests = struct {
p.sync();
p.settings.wrap = false;
try std.testing.expect(p.executeBuiltinLine(0, "TreeContext"));
- pane.scrollBy(8);
+ pane.scrollBy(pardes.config.tab_width, 8);
pane.hscroll = 4;
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
@@ -409,7 +409,9 @@ const TreeContextTests = struct {
p.sync();
p.settings.wrap = true;
try std.testing.expect(p.executeBuiltinLine(0, "TreeContext"));
- pane.scrollBy(2);
+ // The view's top on line 2 (a scroll's rows would stop in line 0's
+ // three: File.Top).
+ panes.File.setTop(pane, .{ .line = 2 });
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
p.sync();
@@ -994,7 +996,7 @@ test "terminal output keeps following new rows after scrollback eviction" {
for (0..3) |phase| {
if (phase > 0) {
pane.body.mode = .normal;
- pane.scrollBy(-30);
+ pane.scrollBy(pardes.config.tab_width, -30);
try std.testing.expect(pane.termTop() < pages.scrollbar().total - pane.rows);
pardes.keys.enterTty(p, 0);
}
@@ -2032,7 +2034,7 @@ const OutputTests = struct {
try std.testing.expectEqual(next, panes.Output.nextResult(restored_file.content, restored_file.location_rows, path, .{ .line = 2, .col = 5 }));
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
- result.scrollBy(-1000);
+ result.scrollBy(pardes.config.tab_width, -1000);
layout.compute(p);
const surface = try p.render(frame.allocator());
const rect = p.view().rects[pane.search_pane.?];
@@ -2690,7 +2692,7 @@ const TerminalTests = struct {
p.update(.{ .output = .{ .pane = .at(0), .bytes = bytes } });
}
p.shell_rows.stale = true;
- pane.scrollBy(-20);
+ pane.scrollBy(pardes.config.tab_width, -20);
// ONE buffer line standing in for SIX shell rows: everything below slides
// UP five, so the last rows of the body resolve past the viewport's bottom