From f930d53c58187381b2f0df6892546ac1c217c9db Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 22:27:44 -0300 Subject: settings #1, Tagbottom goes, a pane's tag at its head the one value anyone used: layout.bodyTop and tagTop, mouse's seam and clampBorderRow, applyRowSplit, body_layer's copy and the tests' row arithmetic lose their other arm (reads deleted in Core.zig, layout.zig, mouse.zig, draw.zig, gui.zig, macos.zig, whose ABI slot 11 says 0 now, and ninep/events.zig, ninep/tree.zig, look.zig, Messages.zig), with the registry row, SPC t b, Help, /commands, the builtins JSON and the reference row; deleted: the snapshot scripts tagbottom, tagbottomshort and tagbottomimage with their goldens, the behaviour test "placement: under Tagbottom a look from a pane's text goes under its text too", the window scene 10-tagbottom with its gui-goldens line and the macOS parity check tags-bottom; tests that ran both ends of the tag run the head; a dump that kept the field loads without it; perf.zig's harness id moves in the two debug baselines (its reads of the field went); the window scenes after 10-tagbottom (12 to 15, 17) take new gui-goldens lines, the two Tagbottom writes gone from the scene and with them their words on the message row (the base window build running the same scenes gives the same frames); gates on tui: core-test 966/966, behaviour-test 243/243, unit-test 1484/1485, pane-test 171/172, snap all 105 scripts ok, process-test 0 of 37 failed; gui unit-test 1529/1530, gui-golden 0 of 1 failed Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/behaviour/mouse.zig | 45 +++-- test/behaviour/placement.zig | 23 --- test/behaviour/settings.zig | 2 +- test/behaviour/tags.zig | 172 +++++++++----------- test/column_drag.zig | 2 +- test/gui-goldens.txt | 11 +- test/macos-snapshots/rendering-parity.golden | 1 - test/macos-snapshots/rendering-parity.snap | 5 - test/mode.zig | 2 +- test/monkey9p.zig | 2 +- test/output.zig | 19 +-- test/panes.zig | 104 ++++++------ test/perf-baseline-gui-debug.json | 2 +- test/perf-baseline-tui-debug.json | 2 +- test/perf.zig | 4 +- test/process/window.zig | 3 - test/snapshots/tagbottom.golden | 235 --------------------------- test/snapshots/tagbottom.snap | 161 ------------------ test/snapshots/tagbottomimage.golden | 123 -------------- test/snapshots/tagbottomimage.snap | 53 ------ test/snapshots/tagbottomshort.golden | 43 ----- test/snapshots/tagbottomshort.snap | 48 ------ 22 files changed, 171 insertions(+), 891 deletions(-) delete mode 100644 test/snapshots/tagbottom.golden delete mode 100644 test/snapshots/tagbottom.snap delete mode 100644 test/snapshots/tagbottomimage.golden delete mode 100644 test/snapshots/tagbottomimage.snap delete mode 100644 test/snapshots/tagbottomshort.golden delete mode 100644 test/snapshots/tagbottomshort.snap (limited to 'test') diff --git a/test/behaviour/mouse.zig b/test/behaviour/mouse.zig index a0ac7a23..e64e3ef9 100644 --- a/test/behaviour/mouse.zig +++ b/test/behaviour/mouse.zig @@ -53,30 +53,27 @@ test "mouse: everything a B1 chord does while B1 is down is one undo step" { test "mouse: a click past a line's or the file's end puts the caret where insertion types" { for ([_]bool{ false, true }) |already_insert| { - for ([_]bool{ false, true }) |bottom_tag| { - for ([_]struct { text: []const u8, click_row: usize, dot: u32, col: usize, row: usize, result: []const u8 }{ - .{ .text = "abc\nxy", .click_row = 0, .dot = 3, .col = 3, .row = 0, .result = "abcZ\nxy" }, - .{ .text = "abc\nxy", .click_row = 5, .dot = 6, .col = 2, .row = 1, .result = "abc\nxyZ" }, - .{ .text = "abc\n", .click_row = 5, .dot = 4, .col = 0, .row = 1, .result = "abc\nZ" }, - .{ .text = "", .click_row = 5, .dot = 0, .col = 0, .row = 0, .result = "Z" }, - }) |case| { - var s = try Session.initFile(std.testing.allocator, case.text); - defer s.deinit(); - const n = try s.focused(); - if (bottom_tag) try s.write("/ctl", "Tagbottom on\n"); - if (already_insert) try s.keys("i"); - // The first line's number, then a blank, then its text. - const x, const y = try s.where("1 "); - try mouse(&s, "m {d} {d} 1\nm {d} {d} 0\n", .{ x + 2 + 15, y + case.click_row, x + 2 + 15, y + case.click_row }); - try std.testing.expectEqual(.{ case.dot, case.dot }, try s.range(s.at("/pane/{d}/dot", .{n}))); - // The caret is drawn where it is, and insertion draws it there too. - try std.testing.expectEqual(.{ x + 2 + case.col, y + case.row }, (try s.cursor()).?); - if (!already_insert) try s.keys("i"); - try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{n})), " mode:insert ")); - try std.testing.expectEqual(.{ x + 2 + case.col, y + case.row }, (try s.cursor()).?); - try s.keys("Z"); - try s.expect(s.at("/pane/{d}/body", .{n}), case.result); - } + for ([_]struct { text: []const u8, click_row: usize, dot: u32, col: usize, row: usize, result: []const u8 }{ + .{ .text = "abc\nxy", .click_row = 0, .dot = 3, .col = 3, .row = 0, .result = "abcZ\nxy" }, + .{ .text = "abc\nxy", .click_row = 5, .dot = 6, .col = 2, .row = 1, .result = "abc\nxyZ" }, + .{ .text = "abc\n", .click_row = 5, .dot = 4, .col = 0, .row = 1, .result = "abc\nZ" }, + .{ .text = "", .click_row = 5, .dot = 0, .col = 0, .row = 0, .result = "Z" }, + }) |case| { + var s = try Session.initFile(std.testing.allocator, case.text); + defer s.deinit(); + const n = try s.focused(); + if (already_insert) try s.keys("i"); + // The first line's number, then a blank, then its text. + const x, const y = try s.where("1 "); + try mouse(&s, "m {d} {d} 1\nm {d} {d} 0\n", .{ x + 2 + 15, y + case.click_row, x + 2 + 15, y + case.click_row }); + try std.testing.expectEqual(.{ case.dot, case.dot }, try s.range(s.at("/pane/{d}/dot", .{n}))); + // The caret is drawn where it is, and insertion draws it there too. + try std.testing.expectEqual(.{ x + 2 + case.col, y + case.row }, (try s.cursor()).?); + if (!already_insert) try s.keys("i"); + try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{n})), " mode:insert ")); + try std.testing.expectEqual(.{ x + 2 + case.col, y + case.row }, (try s.cursor()).?); + try s.keys("Z"); + try s.expect(s.at("/pane/{d}/body", .{n}), case.result); } } } diff --git a/test/behaviour/placement.zig b/test/behaviour/placement.zig index f6823feb..73d69883 100644 --- a/test/behaviour/placement.zig +++ b/test/behaviour/placement.zig @@ -108,29 +108,6 @@ test "placement: a look from a pane's text goes under its text when it has many try std.testing.expectEqual(was[big][0] + was[big][1], now[big + 1][0] + now[big + 1][1]); } -test "placement: under Tagbottom a look from a pane's text goes under its text too, every line of it still in sight above its tag" { - var tmp = std.testing.tmpDir(.{}); - defer tmp.cleanup(); - try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "second.txt", .data = "second\n" }); - var dir: [4096]u8 = undefined; - const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)]; - var s = try Session.initFile(std.testing.allocator, "alpha\nbeta\ngamma\n"); - defer s.deinit(); - s.detach(); - try s.write("/ctl", "size 200 60\n"); - try s.write("/ctl", "Tagbottom on\n"); - const top = try s.focused(); - try s.write(s.at("/pane/{d}/look", .{top}), s.at("{s}/second.txt\n", .{at})); - // The first pane keeps its three lines with its tag under them, at its - // foot: the split leaves it its tag and its text whichever end the tag - // is on (makenewwindow, util.c:482-486). The new pane starts below. - const alpha = (try s.where("alpha"))[1]; - try std.testing.expectEqual(alpha + 1, (try s.where("beta"))[1]); - try std.testing.expectEqual(alpha + 2, (try s.where("gamma"))[1]); - try std.testing.expectEqual(alpha + 3, try tagRow(&s, "/test.txt")); - try std.testing.expectEqual(alpha + 4, (try s.where("second"))[1]); -} - test "placement: a look from the middle of a column splits only the pane it came from, short ones round it kept short, through a Newcol too" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig index d87e8191..80573e2f 100644 --- a/test/behaviour/settings.zig +++ b/test/behaviour/settings.zig @@ -274,7 +274,7 @@ test "settings: every on/off setting the root ctl reads flips when its word is w // A floor, so a ctl that lists none fails: a bare session's on/off // words, Colors to PagerColor, are ten. try std.testing.expect(flipped >= 10); - for ([_][]const u8{ "Colors off", "Wrap off", "Tagbottom on", "Debug on" }) |want| + for ([_][]const u8{ "Colors off", "Wrap off", "Debug on" }) |want| try std.testing.expectEqualStrings(want, try setting(&s, want[0..std.mem.indexOfScalar(u8, want, ' ').?])); try s.write("/ctl", "Theme acme\n"); try s.write("/ctl", "Shell /bin/sh\n"); diff --git a/test/behaviour/tags.zig b/test/behaviour/tags.zig index 71faed3a..4477e73e 100644 --- a/test/behaviour/tags.zig +++ b/test/behaviour/tags.zig @@ -149,76 +149,67 @@ test "tags: a renamed path moves the tag's cursor with the text after it and a s } test "tags: window keys move between panes from a tag and each tag keeps its cursor" { - for ([_]bool{ false, true }) |bottom| { - var s = try Session.initFile(std.testing.allocator, "body\n"); - defer s.deinit(); - if (bottom) try s.write("/ctl", "Tagbottom on\n"); - const first = try s.focused(); - const second = try s.newPane(); - try s.write(s.at("/pane/{d}/name", .{second}), "/second.txt"); - try s.write("/focus", s.at("{d}", .{first})); - try s.keys(":" ++ home ++ "ll" ++ window ++ "j\n"); - try std.testing.expectEqual(second, try s.focused()); - try s.keys(":" ++ home ++ "llll" ++ window ++ "k\n"); - try std.testing.expectEqual(first, try s.focused()); - try s.keys(":"); - try std.testing.expectEqual(@as(usize, 2), try tagCol(&s, "/test.txt")); - try s.keys(window ++ "j\n:"); - try std.testing.expectEqual(@as(usize, 4), try tagCol(&s, "/second.txt")); - } + var s = try Session.initFile(std.testing.allocator, "body\n"); + defer s.deinit(); + const first = try s.focused(); + const second = try s.newPane(); + try s.write(s.at("/pane/{d}/name", .{second}), "/second.txt"); + try s.write("/focus", s.at("{d}", .{first})); + try s.keys(":" ++ home ++ "ll" ++ window ++ "j\n"); + try std.testing.expectEqual(second, try s.focused()); + try s.keys(":" ++ home ++ "llll" ++ window ++ "k\n"); + try std.testing.expectEqual(first, try s.focused()); + try s.keys(":"); + try std.testing.expectEqual(@as(usize, 2), try tagCol(&s, "/test.txt")); + try s.keys(window ++ "j\n:"); + try std.testing.expectEqual(@as(usize, 4), try tagCol(&s, "/second.txt")); } test "tags: a tag's normal mode is the body's: motions stay in the tag and insert types into it" { - for ([_]bool{ false, true }) |bottom| { - var s = try Session.initFile(std.testing.allocator, "body\n"); - defer s.deinit(); - if (bottom) try s.write("/ctl", "Tagbottom on\n"); - const first = try s.focused(); - try s.write("/ctl", "Newcol\n"); - const right_pane = try s.newPane(); - try s.write("/focus", s.at("{d}", .{first})); - try s.keys(":" ++ home ++ "l"); - try std.testing.expectEqual(@as(usize, 1), try tagCol(&s, "/test.txt")); - try s.keys("hkj"); - try std.testing.expectEqual(@as(usize, 0), try tagCol(&s, "/test.txt")); - try std.testing.expectEqual(first, try s.focused()); - try s.keys(window ++ "l\n"); - try std.testing.expectEqual(right_pane, try s.focused()); - try s.keys(window ++ "h\n"); - try std.testing.expectEqual(first, try s.focused()); - try s.keys(":i\u{F018}hjklHJKL:"); - try std.testing.expectEqualStrings("/test.txt Save Term Collapse DelhjklHJKL:", try tag(&s, first)); - try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{first})), " mode:normal ")); - try s.expect(s.at("/pane/{d}/body", .{first}), "body\n"); - try std.testing.expectEqual(first, try s.focused()); - } + var s = try Session.initFile(std.testing.allocator, "body\n"); + defer s.deinit(); + const first = try s.focused(); + try s.write("/ctl", "Newcol\n"); + const right_pane = try s.newPane(); + try s.write("/focus", s.at("{d}", .{first})); + try s.keys(":" ++ home ++ "l"); + try std.testing.expectEqual(@as(usize, 1), try tagCol(&s, "/test.txt")); + try s.keys("hkj"); + try std.testing.expectEqual(@as(usize, 0), try tagCol(&s, "/test.txt")); + try std.testing.expectEqual(first, try s.focused()); + try s.keys(window ++ "l\n"); + try std.testing.expectEqual(right_pane, try s.focused()); + try s.keys(window ++ "h\n"); + try std.testing.expectEqual(first, try s.focused()); + try s.keys(":i\u{F018}hjklHJKL:"); + try std.testing.expectEqualStrings("/test.txt Save Term Collapse DelhjklHJKL:", try tag(&s, first)); + try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{first})), " mode:normal ")); + try s.expect(s.at("/pane/{d}/body", .{first}), "body\n"); + try std.testing.expectEqual(first, try s.focused()); } test "tags: a tag with a newline in it is as tall as its lines, and each line is typed into and pointed at" { - for ([_]bool{ false, true }) |bottom| { - var s = try Session.initFile(std.testing.allocator, "body\n"); - defer s.deinit(); - const n = try s.focused(); - if (bottom) try s.write("/ctl", "Tagbottom on\n"); - // Insert mode in a tag is a body's: Enter is a new line. - try s.keys(":A\nSecond"); - try std.testing.expectEqualStrings("/test.txt Save Term Collapse Del\nSecond", try tag(&s, n)); - const x, const y = try s.where("/test.txt"); - try std.testing.expectEqual(.{ x, y + 1 }, try s.where("Second")); - // The caret is on the second line, after what was typed. - try std.testing.expectEqual(.{ x + 6, y + 1 }, (try s.cursor()).?); - // The body starts under (or over) the whole tag. - const by = (try s.where("1 body"))[1]; - try std.testing.expect(if (bottom) by < y else by == y + 2); - // A click on the second line puts the tag's cursor on it. - try s.keys("\x1b:"); - try s.write("/mousein", s.at("m {d} {d} 1\nm {d} {d} 0\n", .{ x + 2, y + 1, x + 2, y + 1 })); - try std.testing.expectEqual(.{ x + 2, y + 1 }, (try s.cursor()).?); - // A clicked tag is in normal mode: `i` types where it was clicked. - try s.keys("iX"); - try std.testing.expectEqualStrings("/test.txt Save Term Collapse Del\nSeXcond", try tag(&s, n)); - try s.expect(s.at("/pane/{d}/body", .{n}), "body\n"); - } + var s = try Session.initFile(std.testing.allocator, "body\n"); + defer s.deinit(); + const n = try s.focused(); + // Insert mode in a tag is a body's: Enter is a new line. + try s.keys(":A\nSecond"); + try std.testing.expectEqualStrings("/test.txt Save Term Collapse Del\nSecond", try tag(&s, n)); + const x, const y = try s.where("/test.txt"); + try std.testing.expectEqual(.{ x, y + 1 }, try s.where("Second")); + // The caret is on the second line, after what was typed. + try std.testing.expectEqual(.{ x + 6, y + 1 }, (try s.cursor()).?); + // The body starts under the whole tag. + const by = (try s.where("1 body"))[1]; + try std.testing.expect(by == y + 2); + // A click on the second line puts the tag's cursor on it. + try s.keys("\x1b:"); + try s.write("/mousein", s.at("m {d} {d} 1\nm {d} {d} 0\n", .{ x + 2, y + 1, x + 2, y + 1 })); + try std.testing.expectEqual(.{ x + 2, y + 1 }, (try s.cursor()).?); + // A clicked tag is in normal mode: `i` types where it was clicked. + try s.keys("iX"); + try std.testing.expectEqualStrings("/test.txt Save Term Collapse Del\nSeXcond", try tag(&s, n)); + try s.expect(s.at("/pane/{d}/body", .{n}), "body\n"); } test "tags: a tag with more lines than rows scrolls to keep its caret in view" { @@ -469,33 +460,30 @@ test "tags: truncating a tag clears its own text, u in the tag undoes it, and > try std.testing.expectEqualStrings("/test.txt Make\nMore\n Tail\n", try tag(&s, n)); } -test "tags: a pane tag's file name is tinted, its directory, dirty marker and words not, the tag at the top or the bottom" { - for ([_]bool{ false, true }) |bottom| { - var s = try Session.initFile(std.testing.allocator, "body\n"); - defer s.deinit(); - const n = try s.focused(); - try s.write("/ctl", "FocusTint off\n"); - if (bottom) try s.write("/ctl", "Tagbottom\n"); - try s.write(s.at("/pane/{d}/name", .{n}), "/project/界file.zig\n"); - try s.write(s.at("/pane/{d}/dirty", .{n}), "1"); - const x0, const y = try s.where("/project/"); - const screen = try s.screen(); - const styles = try s.styles(); - const cols = try std.unicode.utf8CountCodepoints(screen[0..std.mem.indexOfScalar(u8, screen, '\n').?]); - var rows = std.mem.splitScalar(u8, screen, '\n'); - for (0..y) |_| _ = rows.next(); - var cells = (try std.unicode.Utf8View.init(rows.next().?)).iterator(); - var x: usize = 0; - var tinted: ?[]const u8 = null; - var ink: ?[]const u8 = null; - while (cells.nextCodepointSlice()) |cell| : (x += 1) { - if (x < x0 or std.mem.eql(u8, cell, " ")) continue; - // `界file.zig`: the wide glyph's two cells, then eight. - const in_name = x >= x0 + "/project/".len and x < x0 + "/project/".len + 10; - const want = if (in_name) &tinted else &ink; - if (want.* == null) want.* = styles[y * cols + x]; - try std.testing.expectEqualStrings(want.*.?, styles[y * cols + x]); - } - try std.testing.expect(!std.mem.eql(u8, tinted.?, ink.?)); +test "tags: a pane tag's file name is tinted, its directory, dirty marker and words not" { + var s = try Session.initFile(std.testing.allocator, "body\n"); + defer s.deinit(); + const n = try s.focused(); + try s.write("/ctl", "FocusTint off\n"); + try s.write(s.at("/pane/{d}/name", .{n}), "/project/界file.zig\n"); + try s.write(s.at("/pane/{d}/dirty", .{n}), "1"); + const x0, const y = try s.where("/project/"); + const screen = try s.screen(); + const styles = try s.styles(); + const cols = try std.unicode.utf8CountCodepoints(screen[0..std.mem.indexOfScalar(u8, screen, '\n').?]); + var rows = std.mem.splitScalar(u8, screen, '\n'); + for (0..y) |_| _ = rows.next(); + var cells = (try std.unicode.Utf8View.init(rows.next().?)).iterator(); + var x: usize = 0; + var tinted: ?[]const u8 = null; + var ink: ?[]const u8 = null; + while (cells.nextCodepointSlice()) |cell| : (x += 1) { + if (x < x0 or std.mem.eql(u8, cell, " ")) continue; + // `界file.zig`: the wide glyph's two cells, then eight. + const in_name = x >= x0 + "/project/".len and x < x0 + "/project/".len + 10; + const want = if (in_name) &tinted else &ink; + if (want.* == null) want.* = styles[y * cols + x]; + try std.testing.expectEqualStrings(want.*.?, styles[y * cols + x]); } + try std.testing.expect(!std.mem.eql(u8, tinted.?, ink.?)); } diff --git a/test/column_drag.zig b/test/column_drag.zig index 7f5b6e94..8c71ba74 100644 --- a/test/column_drag.zig +++ b/test/column_drag.zig @@ -143,7 +143,7 @@ test "column grip is separate from compact text and the resize seam" { if (pane_layer.rows > 0 and pane_layer.kind == .pane and pane_layer.id == pane_id) try std.testing.expectEqual((try tagLayer(p, column)).viewport.x, pane_layer.viewport.x); } - const pane_tag_y = if (p.settings.tag_bottom) rect.y + rect.h - pardes.BOX_H else rect.y; + const pane_tag_y = rect.y; for (0..config.GUTTER) |offset| { const x = rect.x + @as(u16, @intCast(offset)); try std.testing.expectEqual(surface.at(x, pane_tag_y).style.font_role, surface.at(x, pardes.TOPBAR_H).style.font_role); diff --git a/test/gui-goldens.txt b/test/gui-goldens.txt index 02fccf40..e9882515 100644 --- a/test/gui-goldens.txt +++ b/test/gui-goldens.txt @@ -7,10 +7,9 @@ 07-prompt-notice 4b1511f42b1cc06d3fe8b07e44a296a6c3fb2a37788cf0e9b5b1c7837a00993b 08-wide-glyph-edges c200d9fd0254af6b39a6387a074b1e29efeb3bd4114b373f83650a8bae8900ad 09-collapsed-focus-tint 4ac6f25f742ad68ea00a5033fd6c6c785b3426a0045499f046f99db9310c5721 -10-tagbottom 224d369c583348a9bcdcc4d2ef66529a79da18bfff82ab401af8970f03fafabb -12-multiline-tag 09fe9f8841a14fe3379aa2d87d82fc817f9c011444261d635cec235a32e9a866 -13-image 318720734099917fe92694dfb52f9304e61efb53ff76118621762498b9b114c1 -14-theme-ink 5ce5d040782d7b019da22109867e07ae212ea175b4527b7d2c1c5bcfca055793 -15-theme-acme-light d81855e3204cbb698731cfd72519b7e3454c6b0ac734c01228004c8ee60f8683 +12-multiline-tag 02af5e9e367063f3e15e13bfe69c4fbce2ebf000ca392bd814c348cb7a773e7c +13-image 5b50a99f020ab5d61b5b481cda9e77496f1c03700df5d957f5280ec873e9cfa3 +14-theme-ink 41932127a60a7347c08f84e32bba064c862aa06fa46e2ca9e117a1e37177f534 +15-theme-acme-light 7a0336e9c8429ac0d0fb04e6357e2ee20a69cf57b1c484680222912aeb1877f2 16-debug 8c0d51dddb4badb908a3975952b3a960bc1f1132ffa94e874be7172d36d997d4 -17-terminal bdd828d94de59aba7ce9e35e80d7b4b9081ec663b0a2489e4076279d9b03e0a4 +17-terminal 9acf2cfaefd7e48a3c32a03254307293297c0e5ab9829475f8a94b96decbc35d diff --git a/test/macos-snapshots/rendering-parity.golden b/test/macos-snapshots/rendering-parity.golden index cbb56ab2..fc0d8acd 100644 --- a/test/macos-snapshots/rendering-parity.golden +++ b/test/macos-snapshots/rendering-parity.golden @@ -1,5 +1,4 @@ == backgrounds tags-100 uniform -== backgrounds tags-bottom uniform == backgrounds tags-71 uniform == backgrounds tags-0 uniform == backgrounds invalid-stays-0 uniform diff --git a/test/macos-snapshots/rendering-parity.snap b/test/macos-snapshots/rendering-parity.snap index cdd940c8..332f3155 100644 --- a/test/macos-snapshots/rendering-parity.snap +++ b/test/macos-snapshots/rendering-parity.snap @@ -5,11 +5,6 @@ command Theme forge command TaglineSize 70 stable 700 20000 check-backgrounds tags-100 -command Tagbottom -stable 700 20000 -check-backgrounds tags-bottom -command Tagbottom -stable 700 20000 command WindowOpacity 71 stable 700 20000 check-backgrounds tags-71 diff --git a/test/mode.zig b/test/mode.zig index 42e61c79..6141d898 100644 --- a/test/mode.zig +++ b/test/mode.zig @@ -14,7 +14,7 @@ fn clickModeTag(p: *Pardes) !void { const text = try pardes.tagline.tagText(p, p.scratch.allocator(), pane); const col = std.mem.indexOf(u8, text, "Mode") orelse return error.MissingModeTag; const rect = p.rects[0]; - const row = if (p.settings.tag_bottom) rect.y + rect.h - pardes.BOX_H else rect.y; + const row = rect.y; for ([_]pardes.Mouse.Kind{ .press, .release }) |kind| p.update(.{ .mouse = .{ .button = .left, .kind = kind, .col = rect.x + pardes.TAG_TEXT_INSET + @as(u16, @intCast(col)), .row = row } }); try std.testing.expect(pane.focus == .tag); diff --git a/test/monkey9p.zig b/test/monkey9p.zig index f33c58f8..b3f53093 100644 --- a/test/monkey9p.zig +++ b/test/monkey9p.zig @@ -74,7 +74,7 @@ const builtins = [_][]const u8{ "Look", "Exec", "Kill", "Dump", "Msg", "NextColor", "Themes", "DumpThemes", "TreeContext", "PdfFit", "PdfTint", "PdfSections", "Petscii", "Palette", "Ascii", "Save", "New", "Newcol", "Del", "Filter", "Mode", "Togglettymode", "Edit", "Undo", "Redo", "Collapse", "Delcol", "DelAbove", "DelBelow", "Term", "Repl", "Joincol", "Config", "LocationsConfig", "Messages", "Mini", "Find", "Grep", "Left", - "Down", "Up", "Right", "Back", "Forward", "Last", "Recent", "Jumplist", "Colors", "Wrap", "Tagbottom", "Debug", "FocusTint", + "Down", "Up", "Right", "Back", "Forward", "Last", "Recent", "Jumplist", "Colors", "Wrap", "Debug", "FocusTint", "Verbose", "SyntaxBold", "InactiveDim", "DumpDir", "Theme", "Get", "Put", "Undo", "Redo", "Zerox", "Snarf", "Paste", "Cut", "Sort", "Font", "Local", }; diff --git a/test/output.zig b/test/output.zig index 31027cfc..70518de8 100644 --- a/test/output.zig +++ b/test/output.zig @@ -38,18 +38,15 @@ test "search tint survives wrapping and theme changes while selections remain au pane.file.?.output = .{ .from = .search }; var frame = std.heap.ArenaAllocator.init(std.testing.allocator); defer frame.deinit(); - for ([_]bool{ false, true }) |bottom| { - p.settings.tag_bottom = bottom; - for ([_]bool{ true, false, true }) |colors| { - p.settings.colors = colors; - const surface = try p.render(frame.allocator()); - var marked: usize = 0; - for (surface.cells) |cell| { - if (std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.theme().search_bg.? })) marked += 1; - } - try std.testing.expectEqual(@as(usize, if (colors) 3 else 0), marked); - _ = frame.reset(.retain_capacity); + for ([_]bool{ true, false, true }) |colors| { + p.settings.colors = colors; + const surface = try p.render(frame.allocator()); + var marked: usize = 0; + for (surface.cells) |cell| { + if (std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.theme().search_bg.? })) marked += 1; } + try std.testing.expectEqual(@as(usize, if (colors) 3 else 0), marked); + _ = frame.reset(.retain_capacity); } // The body changes immediately even when dark chrome is still fading. try std.testing.expect(p.executeBuiltinLine(0, "Theme daybreak")); diff --git a/test/panes.zig b/test/panes.zig index c1c2ef9b..45302b6f 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -32,45 +32,42 @@ const TagLayerTests = struct { } test "compact tag layers render and edit Unicode text beyond body column capacity" { - for ([_]bool{ false, true }) |bottom| { - const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 40, .rows = 16 }); - defer p.deinit(); - const pane = try p.setTestFile("body\n"); - p.settings.tag_bottom = bottom; - p.row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 5, .tagline_h = 10 }; - p.gpa.free(pane.file.?.path); - pane.file.?.path = try p.gpa.dupe(u8, "/x"); - try setTag(pane, " " ++ &@as([38]u8, @splat('a')) ++ "\t界 END"); - var frame = std.heap.ArenaAllocator.init(p.gpa); - defer frame.deinit(); - _ = try p.render(frame.allocator()); - const layer = try findLayer(p, .pane, 0); - const text = try pardes.tagline.tagText(p, frame.allocator(), pane); - const at = std.mem.indexOf(u8, text, "END").?; - const col = panes.File.displayWidth(text[0..at]); - try std.testing.expect(col > p.rects[0].w); - try std.testing.expect(col + 3 < layer.cols); - try std.testing.expectEqualStrings("E", layer.cells[col].grapheme()); - try std.testing.expectEqual(@as(u16, 0), pane.tag_scroll); - const x = @as(f32, @floatFromInt(layer.viewport.x)) * 10 + (@as(f32, @floatFromInt(col)) + 0.5) * 5; - var stale = mouse(layer, x, .press); - stale.tag_hit.?.serial +%= 1; - p.update(.{ .mouse = stale }); - try std.testing.expect(pane.focus == .body); - p.update(.{ .mouse = mouse(layer, x, .press) }); - p.update(.{ .mouse = mouse(layer, x, .release) }); - try std.testing.expect(pane.focus == .tag); - try std.testing.expectEqual(at, @as(usize, @intCast(pane.tag.cur_col))); - // A clicked tag is in normal mode: `i` types where it was clicked. - p.update(.{ .key = .{ .cp = 'i', .text = "i" } }); - p.update(.{ .key = .{ .cp = 'X', .text = "X" } }); - _ = try p.render(frame.allocator()); - const edited = try pardes.tagline.tagText(p, frame.allocator(), pane); - try std.testing.expect(std.mem.endsWith(u8, edited, "界 XEND")); - try std.testing.expectEqual(@as(u16, 0), pane.tag_scroll); - try std.testing.expectEqualStrings("body\n", pane.file.?.content); - p.update(.{ .key = .{ .cp = Key.escape } }); - } + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 40, .rows = 16 }); + defer p.deinit(); + const pane = try p.setTestFile("body\n"); + p.row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 5, .tagline_h = 10 }; + p.gpa.free(pane.file.?.path); + pane.file.?.path = try p.gpa.dupe(u8, "/x"); + try setTag(pane, " " ++ &@as([38]u8, @splat('a')) ++ "\t界 END"); + var frame = std.heap.ArenaAllocator.init(p.gpa); + defer frame.deinit(); + _ = try p.render(frame.allocator()); + const layer = try findLayer(p, .pane, 0); + const text = try pardes.tagline.tagText(p, frame.allocator(), pane); + const at = std.mem.indexOf(u8, text, "END").?; + const col = panes.File.displayWidth(text[0..at]); + try std.testing.expect(col > p.rects[0].w); + try std.testing.expect(col + 3 < layer.cols); + try std.testing.expectEqualStrings("E", layer.cells[col].grapheme()); + try std.testing.expectEqual(@as(u16, 0), pane.tag_scroll); + const x = @as(f32, @floatFromInt(layer.viewport.x)) * 10 + (@as(f32, @floatFromInt(col)) + 0.5) * 5; + var stale = mouse(layer, x, .press); + stale.tag_hit.?.serial +%= 1; + p.update(.{ .mouse = stale }); + try std.testing.expect(pane.focus == .body); + p.update(.{ .mouse = mouse(layer, x, .press) }); + p.update(.{ .mouse = mouse(layer, x, .release) }); + try std.testing.expect(pane.focus == .tag); + try std.testing.expectEqual(at, @as(usize, @intCast(pane.tag.cur_col))); + // A clicked tag is in normal mode: `i` types where it was clicked. + p.update(.{ .key = .{ .cp = 'i', .text = "i" } }); + p.update(.{ .key = .{ .cp = 'X', .text = "X" } }); + _ = try p.render(frame.allocator()); + const edited = try pardes.tagline.tagText(p, frame.allocator(), pane); + try std.testing.expect(std.mem.endsWith(u8, edited, "界 XEND")); + try std.testing.expectEqual(@as(u16, 0), pane.tag_scroll); + try std.testing.expectEqualStrings("body\n", pane.file.?.content); + p.update(.{ .key = .{ .cp = Key.escape } }); } test "compact tag pointer keeps physical grips and adjacent header ownership" { @@ -838,22 +835,19 @@ const TagNameTintTests = struct { // A file pane's is test/behaviour/tags.zig's; a search pane's needs // results put in through fillResults. test "tag filename tint of a search pane excludes its directory and command" { - for ([_]bool{ false, true }) |bottom| { - const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 24 }); - defer p.deinit(); - p.locations_config.layout = .@"inline"; - const pane = try p.setTestFile("body\n"); - p.gpa.free(pane.file.?.path); - pane.file.?.path = try p.gpa.dupe(u8, "/project/界file.zig"); - pane.file.?.revision += 1; - configure(p); - defer p.custom_theme = null; - p.settings.tag_bottom = bottom; - try panes.Output.fillResults(p, 0, "/project", .search, "tint", try p.gpa.dupe(u8, "no matches\n"), null); - const id = pane.search_pane.?; - p.update(.tick); - try std.testing.expect((try check(p, id, p.panes[id].?.file.?.path)) > 0); - } + const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 24 }); + defer p.deinit(); + p.locations_config.layout = .@"inline"; + const pane = try p.setTestFile("body\n"); + p.gpa.free(pane.file.?.path); + pane.file.?.path = try p.gpa.dupe(u8, "/project/界file.zig"); + pane.file.?.revision += 1; + configure(p); + defer p.custom_theme = null; + try panes.Output.fillResults(p, 0, "/project", .search, "tint", try p.gpa.dupe(u8, "no matches\n"), null); + const id = pane.search_pane.?; + p.update(.tick); + try std.testing.expect((try check(p, id, p.panes[id].?.file.?.path)) > 0); } test "tag filename tint follows wrapped Unicode drafted names and yields to selection" { diff --git a/test/perf-baseline-gui-debug.json b/test/perf-baseline-gui-debug.json index ae800a39..e7f577bf 100644 --- a/test/perf-baseline-gui-debug.json +++ b/test/perf-baseline-gui-debug.json @@ -1 +1 @@ -{"harness":"de81ad6bc9756a40","build":{"compiler":"0.17.0","target":"x86_64-linux.5.10...7.2-gnu.2.38","cpu":"x86_64","driver_optimize":"fast","core_optimize":"debug","c_optimize":"fast","terminal_optimize":"safe","platform":"gui","grammars":"full","mupdf":true,"jpx":true,"tracy":false,"terminal_simd":true,"prebuilt_shaders":false},"cols":120,"rows":40,"reps":10,"only":"medium","fixtures":[{"name":"small","lines":1000,"cols":60,"bytes":62694},{"name":"medium","lines":50000,"cols":60,"bytes":3201944},{"name":"large","lines":300000,"cols":60,"bytes":19464444},{"name":"longline","lines":400,"cols":8000,"bytes":3200400}],"cells":[{"op":"open","fixture":"medium","min_us":2290,"med_us":2523,"p90_us":2642,"max_us":2642},{"op":"render","fixture":"medium","min_us":96,"med_us":97,"p90_us":99,"max_us":99},{"op":"key-down","fixture":"medium","min_us":104,"med_us":106,"p90_us":113,"max_us":113},{"op":"key-right","fixture":"medium","min_us":105,"med_us":107,"p90_us":111,"max_us":112},{"op":"page-down","fixture":"medium","min_us":104,"med_us":107,"p90_us":121,"max_us":125},{"op":"wheel","fixture":"medium","min_us":101,"med_us":104,"p90_us":105,"max_us":106},{"op":"edit-char","fixture":"medium","min_us":1023,"med_us":1293,"p90_us":1447,"max_us":1467},{"op":"edit-twin","fixture":"medium","min_us":1089,"med_us":1340,"p90_us":1418,"max_us":1441},{"op":"body-2m","fixture":"medium","min_us":5061,"med_us":8829,"p90_us":11118,"max_us":11667},{"op":"body-appends","fixture":"medium","min_us":149285,"med_us":210882,"p90_us":266047,"max_us":279235},{"op":"deep-sel","fixture":"medium","min_us":87,"med_us":90,"p90_us":96,"max_us":96}]} +{"harness":"1a1e0068d88dc7a7","build":{"compiler":"0.17.0","target":"x86_64-linux.5.10...7.2-gnu.2.38","cpu":"x86_64","driver_optimize":"fast","core_optimize":"debug","c_optimize":"fast","terminal_optimize":"safe","platform":"gui","grammars":"full","mupdf":true,"jpx":true,"tracy":false,"terminal_simd":true,"prebuilt_shaders":false},"cols":120,"rows":40,"reps":10,"only":"medium","fixtures":[{"name":"small","lines":1000,"cols":60,"bytes":62694},{"name":"medium","lines":50000,"cols":60,"bytes":3201944},{"name":"large","lines":300000,"cols":60,"bytes":19464444},{"name":"longline","lines":400,"cols":8000,"bytes":3200400}],"cells":[{"op":"open","fixture":"medium","min_us":2290,"med_us":2523,"p90_us":2642,"max_us":2642},{"op":"render","fixture":"medium","min_us":96,"med_us":97,"p90_us":99,"max_us":99},{"op":"key-down","fixture":"medium","min_us":104,"med_us":106,"p90_us":113,"max_us":113},{"op":"key-right","fixture":"medium","min_us":105,"med_us":107,"p90_us":111,"max_us":112},{"op":"page-down","fixture":"medium","min_us":104,"med_us":107,"p90_us":121,"max_us":125},{"op":"wheel","fixture":"medium","min_us":101,"med_us":104,"p90_us":105,"max_us":106},{"op":"edit-char","fixture":"medium","min_us":1023,"med_us":1293,"p90_us":1447,"max_us":1467},{"op":"edit-twin","fixture":"medium","min_us":1089,"med_us":1340,"p90_us":1418,"max_us":1441},{"op":"body-2m","fixture":"medium","min_us":5061,"med_us":8829,"p90_us":11118,"max_us":11667},{"op":"body-appends","fixture":"medium","min_us":149285,"med_us":210882,"p90_us":266047,"max_us":279235},{"op":"deep-sel","fixture":"medium","min_us":87,"med_us":90,"p90_us":96,"max_us":96}]} diff --git a/test/perf-baseline-tui-debug.json b/test/perf-baseline-tui-debug.json index b6c766e1..464ec4d9 100644 --- a/test/perf-baseline-tui-debug.json +++ b/test/perf-baseline-tui-debug.json @@ -1 +1 @@ -{"harness":"de81ad6bc9756a40","build":{"compiler":"0.17.0","target":"x86_64-linux.5.10...7.2-gnu.2.38","cpu":"x86_64","driver_optimize":"fast","core_optimize":"debug","c_optimize":"fast","terminal_optimize":"safe","platform":"tui","grammars":"full","mupdf":true,"jpx":true,"tracy":false,"terminal_simd":true,"prebuilt_shaders":false},"cols":120,"rows":40,"reps":10,"only":"medium","fixtures":[{"name":"small","lines":1000,"cols":60,"bytes":62694},{"name":"medium","lines":50000,"cols":60,"bytes":3201944},{"name":"large","lines":300000,"cols":60,"bytes":19464444},{"name":"longline","lines":400,"cols":8000,"bytes":3200400}],"cells":[{"op":"open","fixture":"medium","min_us":1820,"med_us":2128,"p90_us":2500,"max_us":3046},{"op":"render","fixture":"medium","min_us":90,"med_us":96,"p90_us":98,"max_us":101},{"op":"key-down","fixture":"medium","min_us":101,"med_us":103,"p90_us":105,"max_us":114},{"op":"key-right","fixture":"medium","min_us":101,"med_us":103,"p90_us":106,"max_us":112},{"op":"page-down","fixture":"medium","min_us":97,"med_us":102,"p90_us":103,"max_us":105},{"op":"wheel","fixture":"medium","min_us":97,"med_us":102,"p90_us":112,"max_us":160},{"op":"edit-char","fixture":"medium","min_us":838,"med_us":899,"p90_us":1129,"max_us":1167},{"op":"edit-twin","fixture":"medium","min_us":869,"med_us":1099,"p90_us":1321,"max_us":1393},{"op":"body-2m","fixture":"medium","min_us":4820,"med_us":8314,"p90_us":11931,"max_us":12182},{"op":"body-appends","fixture":"medium","min_us":125039,"med_us":170714,"p90_us":213376,"max_us":232728},{"op":"deep-sel","fixture":"medium","min_us":90,"med_us":92,"p90_us":96,"max_us":101}]} +{"harness":"1a1e0068d88dc7a7","build":{"compiler":"0.17.0","target":"x86_64-linux.5.10...7.2-gnu.2.38","cpu":"x86_64","driver_optimize":"fast","core_optimize":"debug","c_optimize":"fast","terminal_optimize":"safe","platform":"tui","grammars":"full","mupdf":true,"jpx":true,"tracy":false,"terminal_simd":true,"prebuilt_shaders":false},"cols":120,"rows":40,"reps":10,"only":"medium","fixtures":[{"name":"small","lines":1000,"cols":60,"bytes":62694},{"name":"medium","lines":50000,"cols":60,"bytes":3201944},{"name":"large","lines":300000,"cols":60,"bytes":19464444},{"name":"longline","lines":400,"cols":8000,"bytes":3200400}],"cells":[{"op":"open","fixture":"medium","min_us":1820,"med_us":2128,"p90_us":2500,"max_us":3046},{"op":"render","fixture":"medium","min_us":90,"med_us":96,"p90_us":98,"max_us":101},{"op":"key-down","fixture":"medium","min_us":101,"med_us":103,"p90_us":105,"max_us":114},{"op":"key-right","fixture":"medium","min_us":101,"med_us":103,"p90_us":106,"max_us":112},{"op":"page-down","fixture":"medium","min_us":97,"med_us":102,"p90_us":103,"max_us":105},{"op":"wheel","fixture":"medium","min_us":97,"med_us":102,"p90_us":112,"max_us":160},{"op":"edit-char","fixture":"medium","min_us":838,"med_us":899,"p90_us":1129,"max_us":1167},{"op":"edit-twin","fixture":"medium","min_us":869,"med_us":1099,"p90_us":1321,"max_us":1393},{"op":"body-2m","fixture":"medium","min_us":4820,"med_us":8314,"p90_us":11931,"max_us":12182},{"op":"body-appends","fixture":"medium","min_us":125039,"med_us":170714,"p90_us":213376,"max_us":232728},{"op":"deep-sel","fixture":"medium","min_us":90,"med_us":92,"p90_us":96,"max_us":101}]} diff --git a/test/perf.zig b/test/perf.zig index 0aa4cf91..236716ae 100644 --- a/test/perf.zig +++ b/test/perf.zig @@ -591,7 +591,7 @@ fn measure(op: Op, fx: Fixture, path: []const u8, expected_bytes: usize, reps: u const before = .{ .row = pane.body.cur_row, .col = pane.body.cur_col, .scroll = pane.scroll(), .len = pane.file.?.content.len }; const rect = core.rects[id]; const wheel_col = rect.x + pardes.config.GUTTER; - const wheel_row = if (core.settings.tag_bottom) rect.y else rect.y + pardes.BOX_H; + const wheel_row = rect.y + pardes.BOX_H; const t0 = nowNs(); switch (op) { .open => unreachable, @@ -770,7 +770,7 @@ fn checkTerminalTail(core: *pardes.Pardes, surface: *pardes.Surface, batch: usiz const pane = core.panes[0] orelse return error.MissingTerminal; const rect = core.rects[0]; const x = rect.x + pardes.config.GUTTER; - const y = (if (core.settings.tag_bottom) rect.y else rect.y + pardes.BOX_H) + pardes.panes.terminal.gridCursor(pane).y; + const y = rect.y + pardes.BOX_H + pardes.panes.terminal.gridCursor(pane).y; var expected_buffer: [32]u8 = undefined; const expected = try std.fmt.bufPrint(&expected_buffer, "TURN {d:0>10} READY", .{batch}); for (expected, 0..) |byte, col| { diff --git a/test/process/window.zig b/test/process/window.zig index 3d197c09..b7397fec 100644 --- a/test/process/window.zig +++ b/test/process/window.zig @@ -297,9 +297,6 @@ fn goldens(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try f.write(f.at("/pane/{d}/ctl", .{notes_pane}), "Collapse\n"); try shot(&d, a, &results, keep, "09-collapsed-focus-tint", "latest.ppm"); try f.write(f.at("/pane/{d}/ctl", .{notes_pane}), "Collapse\n"); - try f.write("/ctl", "Tagbottom\n"); - try shot(&d, a, &results, keep, "10-tagbottom", "latest.ppm"); - try f.write("/ctl", "Tagbottom\n"); try f.write(f.at("/pane/{d}/tag", .{first}), " Second\nthird line of the tag"); try shot(&d, a, &results, keep, "12-multiline-tag", "latest.ppm"); try f.write(f.at("/pane/{d}/look", .{first}), root ++ "/ramp.ppm\n"); diff --git a/test/snapshots/tagbottom.golden b/test/snapshots/tagbottom.golden deleted file mode 100644 index 8cae6a7d..00000000 --- a/test/snapshots/tagbottom.golden +++ /dev/null @@ -1,235 +0,0 @@ -== snap boot grid=100x31 cursor=7,3 -| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit -| New Term Find Grep Joincol Delcol -| /tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del -| 1 aaa -| 2 bbb -| 3 ccc -| 4 ddd -| 5 eee -| 6 fff -| 7 ggg -| 8 hhh -| 9 iii -| 10 jjj -| 11 kkk -| 12 lll -| 13 mmm -| 14 nnn -| 15 ooo -| 16 ppp -| 17 qqq -| 18 rrr -| 19 sss -| 20 ttt -| 21 uuu -| 22 vvv -| 23 www -| 24 xxx -| 25 yyy -| 26 zzz -== snap on grid=100x31 cursor=7,2 -|2: 1 aaa -|3: 2 bbb -|4: 3 ccc -|5: 4 ddd -|6: 5 eee -|7: 6 fff -|8: 7 ggg -|9: 8 hhh -|10: 9 iii -|11: 10 jjj -|12: 11 kkk -|13: 12 lll -|14: 13 mmm -|15: 14 nnn -|16: 15 ooo -|17: 16 ppp -|18: 17 qqq -|19: 18 rrr -|20: 19 sss -|21: 20 ttt -|22: 21 uuu -|23: 22 vvv -|24: 23 www -|25: 24 xxx -|26: 25 yyy -|27: 26 zzz -|28: -|30: /tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del -== snap off grid=100x31 cursor=7,3 -|2: /tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del -|3: 1 aaa -|4: 2 bbb -|5: 3 ccc -|6: 4 ddd -|7: 5 eee -|8: 6 fff -|9: 7 ggg -|10: 8 hhh -|11: 9 iii -|12: 10 jjj -|13: 11 kkk -|14: 12 lll -|15: 13 mmm -|16: 14 nnn -|17: 15 ooo -|18: 16 ppp -|19: 17 qqq -|20: 18 rrr -|21: 19 sss -|22: 20 ttt -|23: 21 uuu -|24: 22 vvv -|25: 23 www -|26: 24 xxx -|27: 25 yyy -|28: 26 zzz -|30: -== snap tag-typed grid=100x31 cursor=74,30 -|2: 1 aaa -|3: 2 bbb -|4: 3 ccc -|5: 4 ddd -|6: 5 eee -|7: 6 fff -|8: 7 ggg -|9: 8 hhh -|10: 9 iii -|11: 10 jjj -|12: 11 kkk -|13: 12 lll -|14: 13 mmm -|15: 14 nnn -|16: 15 ooo -|17: 16 ppp -|18: 17 qqq -|19: 18 rrr -|20: 19 sss -|21: 20 ttt -|22: 21 uuu -|23: 22 vvv -|24: 23 www -|25: 24 xxx -|26: 25 yyy -|27: 26 zzz -|28: -|30: /tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del bottom.txt -== snap look-bottom-tag grid=100x31 cursor=7,16 -|15: /tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del bottom.txt -|16: 1 ZZONE -|17: 2 ZZTWO -|18: -|19: -|20: -|21: -|22: -|23: -|24: -|25: -|26: -|27: -|30: /tmp/pardes-snap/tagbottom/cwd/bottom.txt Save Term Collapse Del -== snap body-cursor grid=100x31 cursor=9,6 -== snap seam-noop grid=100x31 cursor=12,16 -== snap seam-dragged grid=100x31 cursor=12,12 -|11: /tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del bottom.txt -|12: 1 ZZONE -|13: 2 ZZTWO -|14: -|15: -|16: -|17: -== snap gutter-click grid=100x31 cursor=9,5 -|2: 2 bbb -|3: 3 ccc -|4: 4 ddd -|5: 5 eee -|6: 6 fff -|7: 7 ggg -|8: 8 hhh -|9: 9 iii -|10: 10 jjj -== snap search-prompt grid=100x31 cursor=5,21 -|20: /tmp/pardes-snap/tagbottom/cwd/bottom.txt Save Term Collapse Del -|21: /ZZ -|22: bottom.txt:1:1 ZZONE -|23: bottom.txt:2:1 ZZTWO -|30: ^ +Search 1/2 Del -== snap leader grid=100x31 cursor=9,13 -|12: 1 ZZONE SPC -|20: -|21: -|22: -|23: -|30: /tmp/pardes-snap/tagbottom/cwd/bottom.txt Save Term Collapse Del -== snap cut-down grid=100x31 cursor=7,5 -|2: 1 aaa -|3: 2 bbb -|4: 3 ccc -|5: 4 jj -|6: 5 kkk -|7: 6 lll -|8: 7 mmm -|9: 8 nnn -|10: 9 ooo -|11: */tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del bottom.txt -|12: 1 ZZONE -== file cut-buffer -aaa -bbb -ccc -jj -kkk -lll -mmm -nnn -ooo -ppp -qqq -rrr -sss -ttt -uuu -vvv -www -xxx -yyy -zzz -== end file -== snap del-bottom-tag grid=100x31 cursor=7,5 -|11: 10 ppp -|12: 11 qqq -|13: 12 rrr -|14: 13 sss -|15: 14 ttt -|16: 15 uuu -|17: 16 vvv -|18: 17 www -|19: 18 xxx -|20: 19 yyy -|21: 20 zzz -|30: /tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del bottom.txt -== snap off-again grid=100x31 cursor=7,6 -|2: /tmp/pardes-snap/tagbottom/cwd/top.txt Save Term Collapse Del bottom.txt -|3: 1 aaa -|4: 2 bbb -|5: 3 ccc -|6: 4 jj -|7: 5 kkk -|8: 6 lll -|9: 7 mmm -|10: 8 nnn -|11: 9 ooo -|12: 10 ppp -|13: 11 qqq -|14: 12 rrr -|15: 13 sss -|16: 14 ttt -|17: 15 uuu -|18: 16 vvv -|19: 17 www -|20: 18 xxx -|21: 19 yyy -|22: 20 zzz -|30: diff --git a/test/snapshots/tagbottom.snap b/test/snapshots/tagbottom.snap deleted file mode 100644 index 7ce0ae5a..00000000 --- a/test/snapshots/tagbottom.snap +++ /dev/null @@ -1,161 +0,0 @@ -# Tagbottom: every pane's tagline on its LAST row instead of its first, and the -# transient message row (prompts, messages, the SPC indicator) stepping up to -# the row just above it. One global bool, so the whole screen flips at once. -# -# The two things worth pinning here are not pixels. The first is that a click -# still lands where it looks like it lands: the Sel coordinate space is -# UNCHANGED (row 0 is the tag, the body starts at BOX_H) and the mouse maps a -# screen row into it, so a look or an execute on a bottom tagline acts on the -# word under the pointer instead of silently sweeping whatever body row shares -# that number. Every mouse assertion below is therefore a CONSEQUENCE — a pane -# appearing, a pane going away, a view scrolling by a counted number of rows — -# and not a picture of a highlight. The tagline-execute pair is what caught the -# bug this script exists for: before the tag row got its own arm in the -# execute/look press, both ran a blank body row and a golden recorded the -# no-op as if it had passed. -# The second is that turning it back off restores the top-tagline layout -# exactly: `off` is byte-for-byte `boot`, cursor included. -file top.txt aaa\nbbb\nccc\nddd\neee\nfff\nggg\nhhh\niii\njjj\nkkk\nlll\nmmm\nnnn\nooo\nppp\nqqq\nrrr\nsss\nttt\nuuu\nvvv\nwww\nxxx\nyyy\nzzz -file bottom.txt ZZONE\nZZTWO -# Builtins announce themselves by default, and an announcement is a band at -# the top of the body -- which moves every row this script clicks. What the -# verbs do is what is under test, not the announcement. -config Verbose off -start 31 100 top.txt -wait 8000 Newcol Joincol -wait 8000 top.txt -stable 700 20000 -snap boot -# SPC t b. The tag leaves row 1 for row 29, the body slides up one row, and -# the cursor goes with it (7,2 -> 7,1) because it is on the same file line. -key space t b -stable 700 15000 -snap on -# ...and straight back. This grid must equal `boot`'s, to the cell. -key space t b -stable 700 15000 -snap off -key space t b -stable 700 15000 -# CLICK the bottom tagline (col 50 of row 30, the pane's last row) and type -# into it. A clicked tag is insert mode, so the text lands as text, and the -# cursor is down on the tagline with it. Col 50 is past the end of the path, -# which is read-only — a click inside it parks the cursor there and the typing -# goes nowhere. -# Past the last word rather than at a counted column: the tagline's words -# have moved since (Del is last now), and a column that lands INSIDE one -# types the filename into the middle of a builtin's name. -press left 90 31 -release left 90 31 -stable 400 5000 -key i -send \x20bottom.txt -stable 600 8000 -stable 400 5000 -snap tag-typed -# ...and LOOK the word just typed, from that same bottom tagline: bottom.txt -# opens as a second pane below. It only can if the press was mapped to the tag -# — mapped as a body row it lands on blank line 29 and looks nothing at all. -press right @bottom.txt 31 -release right @bottom.txt 31 -wait 10000 ZZONE -stable 700 15000 -snap look-bottom-tag -# a body click in the UPPER pane: the cursor lands on the row under the -# pointer, counted from the pane's first row rather than from a tag that is no -# longer there. Row 6 is grid row 5, the fifth body row, file line 5. -press left 10 7 -release left 10 7 -stable 400 8000 -snap body-cursor -# No row of text is a resize handle: a click on the lower pane's FIRST row -# (grid 16, click row 17), where the seam used to be, is a click in its text, -# and both sizes stay. -press left 40 17 -release left 40 17 -motion 40 25 -stable 500 8000 -snap seam-noop -# A terminal has no rule between panes, so the grip resizes them, as acme's -# button moves a window: the lower pane's, on its tag at the bottom, dragged up -# to row 13. The upper pane keeps 10 rows, the lower grows to 19. Both -# taglines follow their own pane's bottom. -press left 1 31 -drag left 1 13 -release left 1 13 -motion 40 25 -stable 500 8000 -snap seam-dragged -# Scroll the upper pane's body down four rows and back up one, so the gutter -# click below has a scrolled view to count from. Not captured: the wheel arm of -# handleMouse is `hovered` plus scrollBy and contains no tag_bottom at all, and -# the body rendering under it is already pinned by `boot`, `on` and -# `body-cursor`. View ends at line 4. -wheel down 40 4 -wheel down 40 4 -wheel down 40 4 -wheel down 40 4 -wheel up 1 4 -stable 400 8000 -# a left click in the gutter scrolls UP to the clicked row, and the row it -# counts from is the BODY's first, not r.y + BOX_H. Row 4 is grid row 3, the -# third body row: two rows up, to line 2. Counted from the wrong end it would -# be one row up, to line 3. -press left 1 5 -release left 1 5 -stable 400 8000 -snap gutter-click -# `/` in the lower pane's body arms the search input. The prompt is CUT off the -# tagline and drawn on the message row with the cursor — and with Tagbottom the -# two are adjacent: the tail keeps its builtins on row 29 while `/ZZ` and the -# cursor sit on row 28, the last body row. The tagline under it stays whole — -# the prompt must not have eaten the row it was cut from. -press left 10 15 -release left 10 15 -stable 400 5000 -key / -send ZZ -stable 600 8000 -stable 400 5000 -snap search-prompt -key esc -settle 100 -stable 400 5000 -# the SPC leader indicator lives on that same message row, right-aligned -key space -stable 400 5000 -snap leader -key esc -settle 100 -stable 400 5000 -# THE INVERSION. Sweeping DOWN past the last body row is the ordinary "select -# to the end" gesture, and with the tag drawn BELOW the body it lands on the -# tagline — Sel row 0. Unclamped that drives the selection's far end to the TOP -# of Sel space: the highlight jumps ABOVE the anchor and a 1-2 Cut deletes lines -# nobody swept. Anchored on grid row 3 (file line 4) and dragged onto the upper -# pane's tag row, the sweep must cover lines 4..10 downward, not 2..4 upward. -press left 8 5 -drag left 8 12 -stable 400 5000 -# ...and the proof is the BUFFER, not the highlight: 1-2 Cut the sweep, save, -# and read the file back. aaa/bbb/ccc survive and kkk..zzz survive; unclamped -# this file lost bbb/ccc/ddd instead and kept eee onward. -press middle 8 12 -release middle 8 12 -release left 8 12 -stable 400 5000 -snap cut-down -key space f s -stable 700 15000 -snapfile cut-buffer /tmp/pardes-snap/tagbottom/cwd/top.txt -# EXECUTE `Del` on the lower pane's bottom tagline: the pane goes away and the -# upper one takes the whole column back. The middle button's half of the same -# tag mapping the look used above. -press middle @Del 31 -release middle @Del 31 -stable 700 15000 -snap del-bottom-tag -# and off again, one pane, its tagline back on row 1 with the body under it -key space t b -stable 700 15000 -snap off-again diff --git a/test/snapshots/tagbottomimage.golden b/test/snapshots/tagbottomimage.golden deleted file mode 100644 index aa94e8c4..00000000 --- a/test/snapshots/tagbottomimage.golden +++ /dev/null @@ -1,123 +0,0 @@ -== snap img-top grid=150x31 cursor=11,8 -| Newcol Joincol Find Grep Help Changelog Tutor Dump Themes Config Debug Exit -| New Term Find Grep Joincol Delcol -| /tmp/pardes-snap/tagbottomimage/cwd Term+bash Save Mode Filter Collapse Del -| ls -| pic.ppm -| -| img petscii:on palette:commodore ascii:on /tmp/pardes-snap/tagbottomimage/cwd/pic.ppm Term Collapse Del -| 4*🬹~F~N🬰|G🬏▚Y~KF🬴s>T&zZ/🬻iTY=`S~╳bkZR37v🬦🬵d4QHZ8X▛▟ -| ^🬪🬛$}DrydNU&wsz=`*r🬒🬓🬳🬟*Y🬴G6🬧f🬮/>t🬧u🬲1Rg1t🬝🬻█ -| ▖#_{🬗X@🬢&$s'C%*=w@🬆▀wq%🬡d┼a┼m─>🬭🬜A▀A🬲H]p🬝🬹 -| %?WX🬕f🬩*TA8n╱┼E▘🬭Y#qo~XVE▐(╳▀H4^[mj🬗=🬒🬕▟█ -| ]Z🬷eb~Oyl3=SL▙a🬱🬉~MPMz}FMu<🬝▚>3&▖🬷WS🬝~█ -| EF-🬑y🬔!r🬙🬐╳O🬩▐%Qj─4za/?/\a🬜"🬖🬈🬛🬟A🬙🬝▄ -| 🬃N@xzOnczIK=t0@🬖j5🬮🬧65▟{🬮🬉🬄🬩zQ9/🬝🬻 -| ╲${&%@"#ctt▀Cr5F;🬐ARM╱uej╳75🬹9▛🬻 -| h^🬜"🬈🬨▜╲|W🬊🬦k6^🬰🬶rZ─▄\z9🬎🬉4^🬎🬻 -| 🬆f│Q_V🬗wGx🬱=5▛5*&V🬟🬄ZrXGz2🬝🬻█ -| !🬷W🬐(🬭]7x_>▗er🬯~▚di🬬4jY:🬝▟ -| gU~🬧3▙bjr\C#kKMpffAjps🬝🬻 -| *🬯G"🬣▟d🬮▀zJ🬪EHV▟╳9}y▛▄ -| ``))~RyJ🬴jA~w=hLpX🬝🬻█ -| 4x▀J"TG7=y-QZ🬙╲~▛🬻 -| 🬯/+╳f9ZG🬕+{QN_🬝🬹 -| E<'─🬫pS!"n4&🬝~ -| m$dx"!2🬳&{🬝🬻 -| *8f🬩▙Jb🬒🬝🬻█ -| m🬩7CiN🬎🬹 -| pG╲L🬝🬻 -| 🬡L🬝▄ -| 🬝~ -== snap img-bottom grid=150x31 cursor=11,8 -|2: ls -|3: pic.ppm -|4: -|5: /tmp/pardes-snap/tagbottomimage/cwd Term+bash Save Mode Filter Collapse Del -|6: Tagbottom -|7: {DbgY🬲s▜M^#▐FUJ[zNq=🬝g/y╱?V@🬱🬙▌UK╱🬍("🬕KJ8hSo🬝🬻 -|8: tX🬆s>🬌`🬵