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

Function ExampleDocument_GetWordAfterCursor

document_test.go:143–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141}
142
143func ExampleDocument_GetWordAfterCursor() {
144 d := &Document{
145 Text: `Hello! my name is c-bata.
146This is a example of Document component.
147`,
148 cursorPosition: len(`Hello! my name is c-bata.
149This is a exam`),
150 }
151 fmt.Println(d.GetWordAfterCursor())
152 // Output:
153 // ple
154}
155
156func ExampleDocument_GetWordBeforeCursorWithSpace() {
157 d := &Document{

Callers

nothing calls this directly

Calls 1

GetWordAfterCursorMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…