What it is
A long decision with two deep branches pushes the rest of the document off screen. Folding hides a block’s body behind its opener line so you can work on the lines around it: the same gesture as a code editor, applied to Runic’s two-space indentation.
How it works
Any line followed by deeper-indented lines is an opener; its body runs to the last deeper line, blank lines included. A small chevron sits in the gutter at each opener, pointing right when closed and down when open, with tooltips “Collapse this block” and “Expand this block”.
Folding is view-only. The editor shows the visible lines while the textarea turns read-only, so line indexes can never shift under a fold. Gutter numbers stay the real ones, which is why a folded document can read 1, 2, 9, 10. The footer says “Folded view (N blocks) — click or type to edit”.
Navigation keys, ⌘C and ⌘A pass through. Any other key, or a click, expands every fold and maps the caret from its folded position into the full document, so you land where you aimed; the triggering keystroke is dropped rather than typed blind. The diagram is built from the full text, so it keeps showing every node. Any text change clears the folds, and so does a jump through the References panel; folds belong to one document, so another document opens unfolded.
Why it matters
A 120-line process reads better when the four decisions you already finished take four lines. Honest numbers mean “line 47” from the audit or the References panel points at the same line whether or not anything is folded.
Limits
While folded you cannot type, drag blocks, extract, or get ghost suggestions; the first editing intent expands the view. Folds are not saved. Process documents only.
How to use it
- Find the chevronA faint chevron sits in the gutter beside an .if, a .then, or any line with indented lines below it. It brightens when you hover it.
- FoldClick the chevron. The body disappears and the opener line gains a “⋯ N lines” chip. The footer switches to “Folded view (1 block) — click or type to edit”.
- Fold moreRepeat on other openers. Nested folds inside a hidden body are irrelevant; folding the outer block hides everything.
- Read with real numbersThe gutter keeps original line numbers, so 12 followed by 31 means lines 13 to 30 are folded.
- ExpandClick the chevron or the “⋯ N lines” chip to open one block, or click anywhere in the text (or start typing) to expand all folds with the caret at the spot you clicked.
Commands & shortcuts
| Chevron (gutter) | Collapse this block / Expand this block |
| ⋯ N lines | Chip on a folded opener; click to expand |
| Arrows, Home, End, PageUp, PageDown | Move through the folded view |
| ⌘C / ⌘A | Copy and select-all work while folded |
| Any other key or click | Expands all folds, caret mapped to the full document |
Tips
- Fold the decisions you have finished before reading the tail of a long flow; the diagram on the right keeps showing them.
- Select-all while folded copies only the visible lines. Expand first when you want the whole document.
- Folds clear on every edit by design. Fold, read, then edit; do not expect folds to survive typing.
- Hover-sync still works: hover a visible line and its node lights up.
Questions
Why does typing expand the fold?
The folded view is read-only so hidden lines can never be edited by accident. Editing intent expands the view first; the keystroke is dropped so nothing is typed into a line you cannot see.
Does folding change what I export or share?
No. Folds are a view state in your browser. The text, the diagram and every export are unaffected.
Can I fold only .if blocks?
Any line with deeper-indented lines under it is foldable: a decision, a branch inside it, or a step with nested lines.