Document has text displayed in terminal and cursor position.
| 11 | |
| 12 | // Document has text displayed in terminal and cursor position. |
| 13 | type Document struct { |
| 14 | Text string |
| 15 | // This represents a index in a rune array of Document.Text. |
| 16 | // So if Document is "日本(cursor)語", cursorPosition is 2. |
| 17 | // But DisplayedCursorPosition returns 4 because '日' and '本' are double width characters. |
| 18 | cursorPosition int |
| 19 | lastKey Key |
| 20 | } |
| 21 | |
| 22 | // NewDocument return the new empty document. |
| 23 | func NewDocument() *Document { |
nothing calls this directly
no outgoing calls
no test coverage detected