summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 19:57:19 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitd0efcd6d63d8e918d66a1c9493870e78586e9567 (patch)
tree4c8a253bcb61c1227cd44605e46dcdc2e274b0ab /src/builtins.zig
parent4442bf09a377297a33b91066bfb5dd8eedb964f0 (diff)
downloadpardes-d0efcd6d63d8e918d66a1c9493870e78586e9567.tar.gz
pardes-d0efcd6d63d8e918d66a1c9493870e78586e9567.zip
A 9P error past 128 bytes keeps its reason: the path in it gives up its middle to …
An Rerror carries 128 bytes (Plan 9's ERRMAX) and the engine cut longer text there, and a builtin's failure was first clipped between words to 256 with ...: either way the end, which says why, was what went. tree.handle now fits a long reason by cutting the middle of its longest path, else of the whole text, on a character boundary, and reportFailure fills its buffer the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index e47afeb4..8a01b3d6 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -574,7 +574,8 @@ fn warnModifiedIn(c: Ctx, asking: Pane.Discarding, which: Asked) bool {
std.fmt.bufPrint(&said_buf, "{s}: Modified ({s} again to discard)", .{ one, @tagName(asking) })
else
std.fmt.bufPrint(&said_buf, "{d} unsaved panes: Modified ({s} again to discard)", .{ count, @tagName(asking) })) catch "unsaved panes: Modified";
- const kept = @import("Messages.zig").clip(said, c.p.fs.failure.len);
+ var room: @TypeOf(c.p.fs.failure) = undefined;
+ const kept = pardes.ctlfs.fitErr(said, &room);
@memcpy(c.p.fs.failure[0..kept.len], kept);
c.p.fs.failure_len = @intCast(kept.len);
}