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

Method GetWordBeforeCursorWithSpace

document.go:90–93  ·  view source on GitHub ↗

GetWordBeforeCursorWithSpace returns the word before the cursor. Unlike GetWordBeforeCursor, it returns string containing space

()

Source from the content-addressed store, hash-verified

88// GetWordBeforeCursorWithSpace returns the word before the cursor.
89// Unlike GetWordBeforeCursor, it returns string containing space
90func (d *Document) GetWordBeforeCursorWithSpace() string {
91 x := d.TextBeforeCursor()
92 return x[d.FindStartOfPreviousWordWithSpace():]
93}
94
95// GetWordAfterCursorWithSpace returns the word after the cursor.
96// Unlike GetWordAfterCursor, it returns string containing space

Calls 2

TextBeforeCursorMethod · 0.95