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

Function ExampleDocument_TextBeforeCursor

document_test.go:62–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62func ExampleDocument_TextBeforeCursor() {
63 d := &Document{
64 Text: `Hello! my name is c-bata.
65This is a example of Document component.
66This component has texts displayed in terminal and cursor position.
67`,
68 cursorPosition: len(`Hello! my name is c-bata.
69This is a exam`),
70 }
71 fmt.Println(d.TextBeforeCursor())
72 // Output:
73 // Hello! my name is c-bata.
74 // This is a exam
75}
76
77func ExampleDocument_TextAfterCursor() {
78 d := &Document{

Callers

nothing calls this directly

Calls 1

TextBeforeCursorMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…