CurrentLineBeforeCursor returns the text from the start of the line until the cursor.
()
| 254 | |
| 255 | // CurrentLineBeforeCursor returns the text from the start of the line until the cursor. |
| 256 | func (d *Document) CurrentLineBeforeCursor() string { |
| 257 | s := strings.Split(d.TextBeforeCursor(), "\n") |
| 258 | return s[len(s)-1] |
| 259 | } |
| 260 | |
| 261 | // CurrentLineAfterCursor returns the text from the cursor until the end of the line. |
| 262 | func (d *Document) CurrentLineAfterCursor() string { |