MCPcopy Index your code
hub / github.com/c-bata/go-prompt / ExampleDocument_GetWordBeforeCursor

Function ExampleDocument_GetWordBeforeCursor

document_test.go:130–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128}
129
130func ExampleDocument_GetWordBeforeCursor() {
131 d := &Document{
132 Text: `Hello! my name is c-bata.
133This is a example of Document component.
134`,
135 cursorPosition: len(`Hello! my name is c-bata.
136This is a exam`),
137 }
138 fmt.Println(d.GetWordBeforeCursor())
139 // Output:
140 // exam
141}
142
143func ExampleDocument_GetWordAfterCursor() {
144 d := &Document{

Callers

nothing calls this directly

Calls 1

GetWordBeforeCursorMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…