diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 07:11:20 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 9ecabb15b648237cca94253a7abc4b556805fde0 (patch) | |
| tree | 973c4956d23e332ba8336499c7dc87156d5eb6e0 /src/ninep/ctl.zig | |
| parent | ee316b57d58c91e103210b1adc428f618f630002 (diff) | |
| download | pardes-9ecabb15b648237cca94253a7abc4b556805fde0.tar.gz pardes-9ecabb15b648237cca94253a7abc4b556805fde0.zip | |
`@p<terminal>:<address>` takes any address over the terminal's logical lines
Only a line number reached a terminal (the line way); any other address
went to lookAddress, which wanted a file and said the terminal was no
text. The body is now the lines a +Search of it lists, addressed from the
cursor, and the match selected as a +Search row's range is.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 47ac2846..acb1b934 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -1969,3 +1969,22 @@ test "@p<serial>:<address> takes any sam address; a miss and an unknown serial a try testing.expectEqualStrings("", rd(p, root, 0, 64).bytes); } +test "@p<terminal>:<address> takes any address over the terminal's lines, selecting the match" { + const p = try th.withTerm(testing.allocator); + defer p.deinit(); + const serial = serialOf(p); + const id = p.paneBySerial(serial).?; + p.update(.{ .output = .{ .pane = @intCast(id), .bytes = "one\r\ntwo MARK three\r\n" } }); + const pane = p.panes[id].?; + const root = @intFromEnum(tree.TopFile.look); + var line: [64]u8 = undefined; + try testing.expectEqual(Status.ok, wr(p, root, try std.fmt.bufPrint(&line, "@p{d}:0/MARK/\n", .{serial})).reply.status); + try testing.expectEqual(@as(i32, 1), pane.body.cur_row); + try testing.expect(pane.body.vsel.active); + // #n lands on that byte: #5 is the `w` of `two`. + try testing.expectEqual(Status.ok, wr(p, root, try std.fmt.bufPrint(&line, "@p{d}:#5\n", .{serial})).reply.status); + try testing.expectEqual(@as(i32, 1), pane.body.cur_row); + try testing.expectEqual(@as(i32, 1), pane.body.cur_col); + _ = wr(p, root, try std.fmt.bufPrint(&line, "@p{d}:/zzqq/\n", .{serial})); + try testing.expect(th.logHas(p, "look: no match for regexp")); +} |
