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 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'test/behaviour/mouse.zig') 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); } } } -- cgit v1.3