GetWordAfterCursor returns the word after the cursor. If we have whitespace after the cursor this returns an empty string.
()
| 81 | // GetWordAfterCursor returns the word after the cursor. |
| 82 | // If we have whitespace after the cursor this returns an empty string. |
| 83 | func (d *Document) GetWordAfterCursor() string { |
| 84 | x := d.TextAfterCursor() |
| 85 | return x[:d.FindEndOfCurrentWord()] |
| 86 | } |
| 87 | |
| 88 | // GetWordBeforeCursorWithSpace returns the word before the cursor. |
| 89 | // Unlike GetWordBeforeCursor, it returns string containing space |