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 --- docs/fs.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/fs.md b/docs/fs.md index f20b521a..1baa9b2c 100644 --- a/docs/fs.md +++ b/docs/fs.md @@ -728,9 +728,11 @@ missed its target cannot then write at the last one. The three flag files `dirty`, `mark` and `scroll` read `0` or `1` and take `0` or `1`: whether the buffer differs from its file, whether a write pushes an undo point (writing `1` pushes one now), and whether a write scrolls the -pane. Every `data`, `xdata` or `body` write is an undo step of its own -while `mark` is 1; to make a loop's writes one step, write `1` (an undo -point here), then `0`, the writes, then `1` again. +pane. The writes of one open of `data`, `xdata` or `body` are one undo +step while `mark` is 1 (so `printf 'a\nb\n' > data` is one, though a +shell writes it a line at a time), and the next open starts another; to +make a loop's writes one step, write `1` (an undo point here), then `0`, +the writes, then `1` again. One rule for what fails: a write fails whenever what it asked for fails, whether it came to a `ctl` (the root's, a pane's, a column's, a pane's -- cgit v1.3