summaryrefslogtreecommitdiff
path: root/src/ninep/tree.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 11:16:17 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitbe11a4e58e86d9b299accd3688c89d3c3a7b4b0c (patch)
treea5932c021958eaa201dfa417ef4752a787a70ae5 /src/ninep/tree.zig
parent536df266a4af38cf20ecb340337a6de2922e8902 (diff)
downloadpardes-be11a4e58e86d9b299accd3688c89d3c3a7b4b0c.tar.gz
pardes-be11a4e58e86d9b299accd3688c89d3c3a7b4b0c.zip
The writes of one open of data, body or xdata are one undo step
bash line-buffers its stdout, so printf 'x\ny\nz\n' > data arrives as three writes and took three Undos. A write now leaves the join mark a truncation already left, so the next write on the file joins its step until the open is released; a truncation and any other edit start a step of their own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/tree.zig')
-rw-r--r--src/ninep/tree.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig
index 64089c01..a8b86a96 100644
--- a/src/ninep/tree.zig
+++ b/src/ninep/tree.zig
@@ -831,6 +831,10 @@ fn releaseHandle(p: *Pardes, req: Req) void {
p.panes[id].?.fs.tag_rewrite = false;
p.panes[id].?.fs.tag_held_newline = false;
};
+ // The writes of one open are one undo step (pane.zig `joined`).
+ if (t == .pane and (t.pane.file == .body or t.pane.file == .data or t.pane.file == .xdata)) if (p.paneBySerial(t.pane.serial)) |id| {
+ p.panes[id].?.fs.joined = null;
+ };
// `: > limit` clears it for good once its open goes.
if (t == .pane and t.pane.file == .limit) if (p.paneBySerial(t.pane.serial)) |id| {
p.panes[id].?.fs.limit_truncated = null;