diff options
Diffstat (limited to 'core/mouse.zig')
| -rw-r--r-- | core/mouse.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/mouse.zig b/core/mouse.zig index 0ff4c7e3..1ef348f8 100644 --- a/core/mouse.zig +++ b/core/mouse.zig @@ -1580,17 +1580,17 @@ test "a wheel over a program that owns it is the program's, in the form it asked .{ .modes = "\x1b[?1007l", .button = .wheel_up, .sent = "" }, }; for (cases) |case| { - p.update(.{ .output = .{ .pane = 0, .bytes = case.modes } }); + p.update(.{ .output = .{ .pane = .at(0), .bytes = case.modes } }); _ = pardes.test_api.ptyBytes(p, 0, &out); p.update(.{ .mouse = .{ .button = case.button, .kind = .press, .col = col, .row = row, .ctrl = case.ctrl, .alt = case.alt, .shift = case.shift } }); try std.testing.expectEqualStrings(case.sent, pardes.test_api.ptyBytes(p, 0, &out)); } // A shell on the main screen: the wheel scrolls its scrollback, and // the shell hears nothing. - p.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?1l\x1b[?1049l" } }); + p.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?1l\x1b[?1049l" } }); for (0..40) |i| { var line: [16]u8 = undefined; - p.update(.{ .output = .{ .pane = 0, .bytes = try std.fmt.bufPrint(&line, "{d}\r\n", .{i}) } }); + p.update(.{ .output = .{ .pane = .at(0), .bytes = try std.fmt.bufPrint(&line, "{d}\r\n", .{i}) } }); } _ = try p.render(frame.allocator()); _ = pardes.test_api.ptyBytes(p, 0, &out); @@ -1600,7 +1600,7 @@ test "a wheel over a program that owns it is the program's, in the form it asked try std.testing.expect(pane.scroll() != was); // A program tracking the mouse on the main screen: Shift and the // wheel scroll the scrollback, the program hears nothing. - p.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?1000h\x1b[?1006h" } }); + p.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?1000h\x1b[?1006h" } }); _ = pardes.test_api.ptyBytes(p, 0, &out); const tracked = pane.scroll(); p.update(.{ .mouse = .{ .button = .wheel_up, .kind = .press, .col = col, .row = row, .shift = true } }); @@ -1671,7 +1671,7 @@ test "a program tracking the mouse gets its clicks, drags and moves over its gri } }.f; // htop's modes: clicks in SGR, a release its own `m`. - p.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?1049h\x1b[?1h\x1b[?1006;1000h" } }); + p.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?1049h\x1b[?1h\x1b[?1006;1000h" } }); _ = pardes.test_api.ptyBytes(p, 0, &out); try std.testing.expectEqualStrings("\x1b[<0;6;4M", try send(p, &out, col, row, .{ .button = .left, .kind = .press })); try std.testing.expect(p.view().drag == .none); @@ -1713,7 +1713,7 @@ test "a program tracking the mouse gets its clicks, drags and moves over its gri // codex's any-event tracking: a drag once per cell, carried past the // grid's edge and clamped there, and bare moves. - p.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?1003h" } }); + p.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?1003h" } }); _ = pardes.test_api.ptyBytes(p, 0, &out); try std.testing.expectEqualStrings("\x1b[<35;9;4M", try send(p, &out, col, row, .{ .button = .none, .kind = .motion, .dx = 3 })); try std.testing.expectEqualStrings("", try send(p, &out, col, row, .{ .button = .none, .kind = .motion, .dx = 3 })); @@ -1737,7 +1737,7 @@ test "a program tracking the mouse gets its clicks, drags and moves over its gri // Legacy X10 bytes: a release is button 3. (Turning 1003 off turns // tracking off, as xterm's one tracking mode goes.) - p.update(.{ .output = .{ .pane = 0, .bytes = "\x1b[?1003l\x1b[?1006l\x1b[?1000h" } }); + p.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?1003l\x1b[?1006l\x1b[?1000h" } }); _ = pardes.test_api.ptyBytes(p, 0, &out); try std.testing.expectEqualStrings("\x1b[M &$", try send(p, &out, col, row, .{ .button = .left, .kind = .press })); try std.testing.expectEqualStrings("\x1b[M#&$", try send(p, &out, col, row, .{ .button = .left, .kind = .release })); |
