TextBeforeCursor returns the text before the cursor.
()
| 61 | |
| 62 | // TextBeforeCursor returns the text before the cursor. |
| 63 | func (d *Document) TextBeforeCursor() string { |
| 64 | r := []rune(d.Text) |
| 65 | return string(r[:d.cursorPosition]) |
| 66 | } |
| 67 | |
| 68 | // TextAfterCursor returns the text after the cursor. |
| 69 | func (d *Document) TextAfterCursor() string { |
no outgoing calls