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

Function ExampleDocument_CurrentLineBeforeCursor

document_test.go:102–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100}
101
102func ExampleDocument_CurrentLineBeforeCursor() {
103 d := &Document{
104 Text: `Hello! my name is c-bata.
105This is a example of Document component.
106This component has texts displayed in terminal and cursor position.
107`,
108 cursorPosition: len(`Hello! my name is c-bata.
109This is a exam`),
110 }
111 fmt.Println(d.CurrentLineBeforeCursor())
112 // Output:
113 // This is a exam
114}
115
116func ExampleDocument_CurrentLineAfterCursor() {
117 d := &Document{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…