class BBS::TextBuffer

The text and the cursor of an input, without a screen: BBS::Field and BBS::Editor keep theirs in one and draw it each in their own way, so a key does the same in both.

The text is a list of lines; the cursor is a line index and a character position in that line.

buffer = BBS::TextBuffer.new('Hello', max: 80)
buffer.edit('!')        # => buffer
buffer.text             # => "Hello!"