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

Method GetWordAfterCursorUntilSeparatorIgnoreNextToCursor

document.go:123–126  ·  view source on GitHub ↗

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

(sep string)

Source from the content-addressed store, hash-verified

121// GetWordAfterCursorUntilSeparatorIgnoreNextToCursor returns the word after the cursor.
122// Unlike GetWordAfterCursor, it returns string containing space
123func (d *Document) GetWordAfterCursorUntilSeparatorIgnoreNextToCursor(sep string) string {
124 x := d.TextAfterCursor()
125 return x[:d.FindEndOfCurrentWordUntilSeparatorIgnoreNextToCursor(sep)]
126}
127
128// FindStartOfPreviousWord returns an index relative to the cursor position
129// pointing to the start of the previous word. Return 0 if nothing was found.