GetWordBeforeCursor returns the word before the cursor. If we have whitespace before the cursor this returns an empty string.
()
| 74 | // GetWordBeforeCursor returns the word before the cursor. |
| 75 | // If we have whitespace before the cursor this returns an empty string. |
| 76 | func (d *Document) GetWordBeforeCursor() string { |
| 77 | x := d.TextBeforeCursor() |
| 78 | return x[d.FindStartOfPreviousWord():] |
| 79 | } |
| 80 | |
| 81 | // GetWordAfterCursor returns the word after the cursor. |
| 82 | // If we have whitespace after the cursor this returns an empty string. |