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

Method GetWordAfterCursorUntilSeparator

document.go:109–112  ·  view source on GitHub ↗

GetWordAfterCursorUntilSeparator returns the text after the cursor until next separator.

(sep string)

Source from the content-addressed store, hash-verified

107
108// GetWordAfterCursorUntilSeparator returns the text after the cursor until next separator.
109func (d *Document) GetWordAfterCursorUntilSeparator(sep string) string {
110 x := d.TextAfterCursor()
111 return x[:d.FindEndOfCurrentWordUntilSeparator(sep)]
112}
113
114// GetWordBeforeCursorUntilSeparatorIgnoreNextToCursor returns the word before the cursor.
115// Unlike GetWordBeforeCursor, it returns string containing space

Calls 2

TextAfterCursorMethod · 0.95