From 5492da0ba1d5f1c1cc0a880f82107961627c9ba6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 02:14:54 -0300 Subject: Addresses snap to runes, not grapheme clusters sam and acme address runes; pardes snapped #n, line:col, dot and data's reads to grapheme clusters, so a lone combining mark or a CRLF's \r could not be addressed. #n, line:col, a search's match, dot (both ways) and data now land on rune boundaries (modal.runeStart and friends), and the tty's cell drawing is untouched. The README, fs.md and the skill say so. Co-Authored-By: Claude Opus 5.5 --- docs/fs.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/fs.md b/docs/fs.md index 8397ed88..e656b66a 100644 --- a/docs/fs.md +++ b/docs/fs.md @@ -493,7 +493,7 @@ out of range`. 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 in bytes from 1, as Look's is, clamped to the end of the line and snapped -back to the start of the character it falls in; a line past the end, or +back to the start of the rune it falls in; a line past the end, or column 0, is `address out of range`. sam would read `12:5` as a syntax error. Truncating `data` or `xdata` deletes the range `addr` names and nothing @@ -646,9 +646,14 @@ action's case says where: `x`/`l` a click executed or looked at in the tag of the tag. Read `n` bytes of the text, not up to a newline -- bytes here, where acme counts runes. Every offset and count pardes serves is in bytes, `#n` and `q0`/`q1` too; the event count follows them rather than switch alone, so an acme library reads pardes -correctly for ASCII text and not beyond it. A `#n` that falls inside a -character, a multibyte rune or a grapheme cluster, snaps back to where that -character starts, and `addr` reads back the snapped offset. A click in a +correctly for ASCII text and not beyond it. Offsets are bytes, but every +address lands on a rune boundary, as sam's and acme's work in runes, never +inside a multibyte rune and never widened to a grapheme cluster: a `#n` +inside a rune snaps back to its start, a `line:col` likewise, a search's +match covers the runes it touches, and a copy of addr to dot keeps its +runes, so a lone combining mark or the `\r` of a CRLF is addressable on its +own; `addr` reads back the snapped offset. (How the terminal draws such a +text, a cluster to a cell, is apart from this.) A click in a tag gives offsets into the whole tag as `tag` reads it, the path first.) An open freezes the ring's text the way `/screen` freezes a frame: reads walk it and end. Writing `follow` to that same open makes reads past it wait for the -- cgit v1.3