GetCursorDownPosition return the relative cursor position (character index) where we would be if the user pressed the arrow-down button.
(count int, preferredColumn int)
| 361 | // GetCursorDownPosition return the relative cursor position (character index) where we would be if the |
| 362 | // user pressed the arrow-down button. |
| 363 | func (d *Document) GetCursorDownPosition(count int, preferredColumn int) int { |
| 364 | var col int |
| 365 | if preferredColumn == -1 { // -1 means nil |
| 366 | col = d.CursorPositionCol() |
| 367 | } else { |
| 368 | col = preferredColumn |
| 369 | } |
| 370 | row := d.CursorPositionRow() + count |
| 371 | return d.TranslateRowColToIndex(row, col) - d.cursorPosition |
| 372 | } |
| 373 | |
| 374 | // Lines returns the array of all the lines. |
| 375 | func (d *Document) Lines() []string { |