Given a buffer with characters and newlines, calculates how high the buffer is and where the cursor goes inside of it.
Computes how tall a line of text is when wrapped at width
.
Computes how tall a line of text is when wrapped at width
.
Even 0-character lines still take up one row!
width = 2 0 -> 1 1 -> 1 2 -> 1 3 -> 2 4 -> 2 5 -> 3
Blockingly reads a line from the given input stream and returns it.
Blockingly reads a line from the given input stream and returns it.
The prompt to display when requesting input
The input-stream where characters come in, e.g. System.in
The output-stream where print-outs go, e.g. System.out
A set of actions that can be taken depending on the input,
code to manipulate the display of the buffer and cursor, without actually changing the logical values inside them.
The core logic around a terminal; it defines the base
filters
API through which anything (including basic cursor-navigation and typing) interacts with the terminal.Maintains basic invariants, such as "cursor should always be within the buffer", and "ansi terminal should reflect most up to date TermState"