From 69b6d714b7fc7788a1bf1c2305262a6e861253e8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 02:12:34 -0300 Subject: A line address past the last newline is sam's empty line there Forward line addresses followed acme's number(), which refuses the empty line after a text's last newline, so 1 of an empty buffer and 2 of "a\n" were out of range and Edit 1i/header/ failed on an empty file. They now follow sam's lineaddr (editors/sam/address.c:180-215): #0,#0 and #2,#2. Co-Authored-By: Claude Opus 5.5 --- docs/fs.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/fs.md b/docs/fs.md index d1be9f6a..8397ed88 100644 --- a/docs/fs.md +++ b/docs/fs.md @@ -483,6 +483,12 @@ pane) and `exec` alike; an unclosed group is refused (``unmatched `{'``). bash's builtin `printf` writes a line at a time, so write a block with a heredoc or `env printf`. +A line number counts newlines as sam's lineaddr does (editors/sam/ +address.c:180), so the empty line just past a text's last newline is an +address: `1` of an empty text is `#0,#0`, `2` of `a\n` is `#2,#2`, and +`Edit 1i/header/` on an empty file inserts; a line past that is `address +out of range`. + `line:col` is a pardes extension to sam's addresses, the spelling Look takes in `file:12:5`: `12:5` is the point at line 12, column 5, and it composes like any simple address (`12:5,14:1`, `12:5+#3`). The column is -- cgit v1.3