Dotty Documentation

0.3.0-bin-SNAPSHOT

object Terminal

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"

[-] Constructors

[-] Members

[+] type Action = (Vector [ Char ], Int) => ( Vector [ Char ], Int )
[+] type MsgAction = (Vector [ Char ], Int) => ( Vector [ Char ], Int, String )
[+] def calculateHeight ( buffer: Vector [ Char ] , width: Int , prompt: String ) : Seq [ Int ]
[+] def calculateHeight0 ( rowLengths: Seq [ Int ] , width: Int ) : Seq [ Int ]
[+] def fragHeight ( length: Int , width: Int ) : Int

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

[+] def noTransform ( x: Vector [ Char ] , i: Int ) : ( Str, Int )
[+] def positionCursor ( cursor: Int , rowLengths: Seq [ Int ] , fragHeights: Seq [ Int ] , width: Int ) : ( Int, Int )
[+] def readLine ( prompt: Prompt , reader: Reader , writer: Writer , filters: Filter , displayTransform: (Vector [ Char ], Int) => ( Str, Int ) ) : Option [ String ]
[+] def splitBuffer ( buffer: Vector [ Char ] ) : Buffer [ Int ]