diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 05:06:55 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 05:18:09 -0300 |
| commit | 1e54e82f763284f086accef902ea1316687c8851 (patch) | |
| tree | 41c0f47fe5eb428cfb5298f55df4f591773ebf2d /src/ninep/pane.zig | |
| parent | 51ddaaf3917ad7968df877d10580d1eadb926688 (diff) | |
| download | pardes-1e54e82f763284f086accef902ea1316687c8851.tar.gz pardes-1e54e82f763284f086accef902ea1316687c8851.zip | |
A body write to an image or a PDF says its body takes no writes, not that the pane has no text "(a terminal, ...)"
A terminal's body takes writes (its keys), so the old words named the
one kind that does. data, sel and dirty keep "this pane has no text",
which is true of all three.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/pane.zig')
| -rw-r--r-- | src/ninep/pane.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig index 3963c605..6a6b444f 100644 --- a/src/ninep/pane.zig +++ b/src/ninep/pane.zig @@ -662,7 +662,7 @@ fn writeBody(p: *Pardes, req: Req, id: usize, pane: *Pane) Reply { if (req.data.len == 0) return .{ .tag = req.tag, .written = 0 }; if (pane.file == null) { // An image's or a PDF's body is no text a write goes into. - if (!pane.isTerminal()) return tree.failText(req.tag, E.INVAL, e_no_text); + if (!pane.isTerminal()) return tree.failText(req.tag, E.INVAL, e_no_body); const take = wholeUtf8(req.data); p.emitWrite(id, req.data[0..take]); return .{ .tag = req.tag, .written = @intCast(take) }; @@ -760,6 +760,9 @@ pub fn applyTagTruncation(p: *Pardes, pane: *Pane) void { /// A write only text takes, to a pane with none: said, as every EINVAL is. pub const e_no_text = "invalid write: this pane has no text (a terminal, an image or a PDF)"; +/// A body write to a pane whose body is a picture: a terminal's takes one +/// (its keys), so the word is not "no text". +pub const e_no_body = "invalid write: an image's or a PDF's body takes no writes"; fn writeData(p: *Pardes, req: Req, pane: *Pane) Reply { if (fileOf(pane) == null) return tree.failText(req.tag, E.INVAL, e_no_text); |
