Expand description
Placing an edit by the lines of a source text (spec
docs/superpowers/specs/2026-10-10-phase-3-4b-fixes-and-colour-design.md
§4.7). Offsets are bytes. The rules step over ASCII only, so every
offset they return is on a character boundary.
Functions§
- arm_
removal - What removing a match arm, bytes
start..end, takes (spec §4.7): a comma after it and the spaces after that, and when nothing else shares its lines but a//comment ending them, those whole lines.Nonewhen anything but a comma, a//comment, a line ending, the text’s end or}follows the arm (plan decision 13). - ending
- The text’s own line ending:
\r\nwhen it holds one, else\n. - is_
blank - Whether
lineholds only spaces, tabs and its line ending. - is_
comment_ line - Whether
line’s first characters after spaces and tabs are//. - keyword_
start - Where the keyword before the item name at byte
name_startstarts:fn,record,type,traitorconst, with anasyncbeforefn(spec §4.7). - line_
after - The edit adding
lineon a line of its own after the line holding byteat: where it goes, and what it inserts, in the text’s own ending. - line_
before_ item - The edit adding
lineand a blank line before the item starting at byteitem_start, above the comment lines directly over it. A comment a blank line separates from the item stays above (spec §4.7). - line_
start - Where the line holding byte
atstarts. - next_
line_ start - Where the line after the one holding byte
atstarts, or the text’s end.