MCPcopy
hub / github.com/c-bata/go-prompt / Document

Struct Document

document.go:13–20  ·  view source on GitHub ↗

Document has text displayed in terminal and cursor position.

Source from the content-addressed store, hash-verified

11
12// Document has text displayed in terminal and cursor position.
13type 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.
23func NewDocument() *Document {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected