Skip to main content

Module paste

Module paste 

Source
Expand description

Big pastes, and the one rule about what “big” means.

A person pasting three hundred lines into a composer did not ask for three hundred lines in the composer: they asked for the text to go somewhere the agent can read it. So a large paste is held aside and the line carries a chip instead — [Pasted #1: 12 line(s), 4210 chars] — and the text goes back in on submit. The model never sees a chip.

The rule lives here rather than in either surface because two surfaces disagreeing about what counts as big is a bug waiting to be filed: the terminal’s composer and the dashboard’s both read PASTE_INLINE_LIMIT, and the dashboard’s is rendered into the page from this constant.

Structs§

Paste
One held-back paste: the chip that stands in for it, and the text itself.

Constants§

PASTE_INLINE_LIMIT
A paste that fits on one line and is no longer than this stays inline: a path, a model name, a sentence quoted from a page. Anything longer, or with a newline in it, becomes a chip.

Functions§

chip_for
The chip that stands in for a paste, numbered from 1 the way the composer numbers them.
expand
The line with every chip it contains replaced by its text, left to right, once each.
fits_inline
Whether this paste can go straight into the line it was dropped into.
lines
How many lines the text has. One trailing newline does not make it two lines — a copy from a terminal almost always carries one, and “2 line(s)” for one line reads like a bug.