From be11a4e58e86d9b299accd3688c89d3c3a7b4b0c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 11:16:17 -0300 Subject: 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 --- src/ninep/tree.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ninep/tree.zig') 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; -- cgit v1.3