diff options
Diffstat (limited to 'docs/design.typ')
| -rw-r--r-- | docs/design.typ | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/docs/design.typ b/docs/design.typ index 82bafb49..8e5f7e6e 100644 --- a/docs/design.typ +++ b/docs/design.typ @@ -530,9 +530,9 @@ Each pane kind keeps its storage and operations together in its own file image pane in `image.zig`), reached through `panes.zig` beside `Pane`. `layout.zig` owns placement and presentation state. `pardes.zig` handles input and cross-pane state directly, without a pane vtable; the rest of the editor -is split by thing as acme is: `edit.zig`, `normal.zig`, `look.zig`, `exec.zig`, -`mouse.zig`, `Messages.zig`, `Pipe.zig`, `colors.zig`, `surface.zig`, -`body_layer.zig` and `dump.zig`. Integration fixtures live +is split by thing as acme is: `Text.zig`, `edit.zig`, `normal.zig`, `tagline.zig`, +`look.zig`, `exec.zig`, `mouse.zig`, `Messages.zig`, `Pipe.zig`, `colors.zig`, +`surface.zig`, `body_layer.zig`, `tag_layer.zig` and `dump.zig`. Integration fixtures live in `test/panes.zig`, `test/output.zig`, and `test/pdf.zig`. = State @@ -770,33 +770,35 @@ pair per theme, and the three per-button tints and the dimmed extra cursors are mixed off it, so what stays fixed is the distinction between buttons and not the colours. -`Drag` is a `union(enum)` with six arms (`pardes.Drag`): `none`, -`border_v`, `border_h`, `move`, `tag`, `select`. `border_v` carries an optional +`Drag` is a `union(enum)` with six arms (`mouse.Drag`): `none`, +`border_v`, `border_h`, `move`, `column_move`, `select`. `border_v` carries an optional `corner`: when the press lands on a cell that is both a column's vertical border and one of the two adjoining columns' own horizontal borders, the one drag moves *both* boundaries — never three, and when both columns happen to be split at the grabbed row the left one wins, so the gesture that existed before is bit-for-bit unchanged. -== The tag is a command line +== The tag is a text -A tag is one line: a live prefix (mode indicator, cwd or path) plus an editable -tail, and the tail gets the full modal editor. The coordinate space is UTF-8 byte -offsets into the *whole* rendered tag, prefix ++ tail, always on grapheme -boundaries (`Pane.tag_col`). The prefix is live chrome, so it is -selectable, yankable and executable but READ-ONLY: every edit op measures from -`edit0` — the first editable byte — and does nothing left of it. +A tag is a `Text` (`Text.zig`), as a body is: acme's `Text`, one per +`what` — the body, the pane's tag, the prompt line, a column's tag and the +workspace tag. Each holds its own cursor, selections, mode and undo, so tags +are edited by the same `edit.zig` and `normal.zig` code as bodies, and the one +key they do not share is `:`, which moves between a pane's body and its tag. +A tag holds any number of lines; a pane's tag takes a row per line up to +`MAX_TAG_ROWS`, each drawn as a tag layer of its own. -`tag_tail` is a fixed `[max_tag_tail]u8`, and the bound IS the storage -(`limits.max_tag_tail`): every writer — `appendTag`, `tagInsert`, -`restoreDumpTail`, the 9P `tag` file — refuses input that does not fit -rather than truncating it. The schema limit and the buffer therefore can never -disagree, which is what lets a dump reader reject data before copying it into a -pane. +A pane's tag shows a live prefix (path, dirty marker, PDF page) before the text +it owns, and that prefix is computed at every read, never stored +(`tagline.tagPrefix`). The Text's coordinates are offsets into its own text +alone, so a rename or a save never moves its cursor. The one translation +point is the whole line as shown: render, the mouse, Look, Exec and the 9P +`tag` file see prefix ++ text, while keyboard motions and edits see only the +text. Editing the path is a separate draft (`Pane.prompt = .name`) committed +by Enter, since a buffer's name is not text it owns. -A tag edit is always insert mode, so it hijacks the body's mode; `tag_mode` -remembers what it hijacked and terminals restore it on exit, which is why -clicking a tag never changes a pane's mode. +The tag's text is bounded by `limits.max_tag_tail`: the 9P `tag` file and a +dump reader refuse input that does not fit rather than truncating it. = Diffing and presenting a frame |
