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

Method GetWordAfterCursorWithSpace

document.go:97–100  ·  view source on GitHub ↗

GetWordAfterCursorWithSpace returns the word after the cursor. Unlike GetWordAfterCursor, it returns string containing space

()

Source from the content-addressed store, hash-verified

95// GetWordAfterCursorWithSpace returns the word after the cursor.
96// Unlike GetWordAfterCursor, it returns string containing space
97func (d *Document) GetWordAfterCursorWithSpace() string {
98 x := d.TextAfterCursor()
99 return x[:d.FindEndOfCurrentWordWithSpace()]
100}
101
102// GetWordBeforeCursorUntilSeparator returns the text before the cursor until next separator.
103func (d *Document) GetWordBeforeCursorUntilSeparator(sep string) string {

Calls 2

TextAfterCursorMethod · 0.95