Skip to main content

Module inspector_reader

Module inspector_reader 

Source
Expand description

The inspector’s value reader: a long value read a screen at a time.

Text is cut into units — a line, or a segment of SEG bytes of a longer line — and only the units on screen are wrapped. Scrolling walks units from the top of the pane; End finds the last unit by searching back for a line break and fills the pane upward. So the end of a 2 MiB value is as near as its start, and no key wraps more than a screen and a unit of it.

A unit’s bounds depend only on the text, never on how it was reached, so a unit wrapped walking down is the unit found walking up.

Structs§

Reader
Where a pane is in its value, and the units of text wrapped so far.
Row
One row of wrapped text, and the bytes of the value it shows.
Shown
A row on screen.
Window
The rows on screen, and whether any are above or below them.

Enums§

Content
What the value pane reads.
TextForm
Text as itself (lines broken, tabs spaced, controls marked) or as an escaped literal on one line.
Tone
Wrap
How a line wider than the pane breaks: at spaces and after / & ? , ; | -, or at the pane’s edge.

Constants§

MAX_HITS
The most matches a search in a value lists.
SEG
The most bytes of a long line wrapped as one unit.

Functions§

count_lines
Lines in text: its line breaks, plus one.
find_hits
Every place needle is in the value, up to MAX_HITS: bytes into text or hex, rows of lines.
hex_per_line
Bytes to a hex row at width cells: 32 where a row of them fits, then 16, 8, 4. A row of n is the offset and a space, three cells a byte, two spaces, and a cell a byte.
hex_row
A hex dump row: offset, the bytes, and their printable ASCII.
hits_in_row
Where needle is in a row on screen, as byte ranges of its text.
ignores_case
Whether a search for needle ignores case: only when it has no capitals.
wrap_lines
Lines of a short text, wrapped to width at word breaks, for the pane’s own sentences and short values.
wrap_unit
Wrap bytes start..end of text to rows of at most width cells. Raw text spaces its tabs to stops of four and marks controls; escaped text is the literal, quoted at the value’s two ends.