summaryrefslogtreecommitdiff
path: root/src/ninep/pane.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 12:19:39 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit4f57043e39396bc958a103f87466870cf8dafe00 (patch)
tree89ec869d2e3b3eb231f14f9298bb56afa9e0f6ae /src/ninep/pane.zig
parentab220b89afcfda848cf84c18cc135a2e5c392b79 (diff)
downloadpardes-4f57043e39396bc958a103f87466870cf8dafe00.tar.gz
pardes-4f57043e39396bc958a103f87466870cf8dafe00.zip
A language server question that finds nothing, cannot be answered or has no room fails, and so does a write to an image's or PDF's body
Callers or Callees with nothing found, Hover or Lspwhy with no room for its pane, and a question asked of no file's pane said nothing, the 9P write succeeding; a body write to an image or PDF pane went nowhere. A write that asks a language server now waits for its answer (turn.lsp_answers), and what fails there -- nothing found, no answer, a backend's @none why, a placement with no room (ENOSPC) -- fails the write and logs its err. No diagnostics is said, not failed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/pane.zig')
-rw-r--r--src/ninep/pane.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index 5ed3f6f4..fe3312b4 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -449,6 +449,8 @@ pub fn write(p: *Pardes, req: Req, id: usize, pane: *Pane, file: PaneFile) Reply
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);
const take = wholeUtf8(req.data);
p.emitWrite(id, req.data[0..take]);
return .{ .tag = req.tag, .written = @intCast(take) };