summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 21:10:00 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit591d3c7baecc434527d02e5894ac0240d2fa1c8d (patch)
treec09c908d58cfc49f796759e6b5f07e86cc7d2267 /src/ninep/ctl.zig
parent6a815117d242688c947a1788e4ffda9ff2bce959 (diff)
downloadpardes-591d3c7baecc434527d02e5894ac0240d2fa1c8d.tar.gz
pardes-591d3c7baecc434527d02e5894ac0240d2fa1c8d.zip
:N on a PDF turns to page N, from the pane and from the root's look; @pN:N answers ok with no err; an address in a pane with no text names the pane
A PDF pane took :N as a word to search for, and @p<pdf>:N failed as "is no text to address" after the page had nothing to do with it, an err in the log for a look that meant something. A PDF's address is now its page: :N turns to it, one past the last is the has-no-page miss, and a byte offset or a pattern is refused saying a PDF's address is a page. The refusal for any other textless pane named an empty path when the look was a bare :addr; it names the image or @p<serial> now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 4aa38292..a14b1efb 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1671,6 +1671,16 @@ test "Save path of a file pane logs a save record naming that path" {
try testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "save {d} /tmp/pardes-save-copy.txt\n", .{serial})));
}
+test "an address looked at in an image pane names the image, never an empty subject" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ const id = p.freeSlot().?;
+ const doc = try p.newDocPane(id);
+ doc.image = .{ .path = try p.gpa.dupe(u8, "/tmp/pardes-pic.ppm") };
+ _ = wr(p, Node.of(doc.serial, .look), ":/x/\n");
+ try testing.expect(th.logHas(p, "look: /tmp/pardes-pic.ppm is no text to address"));
+}
+
test "Save and Save path on an image pane are refused with why, never a silent success" {
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();