GetCursorRightPosition returns relative position for cursor right.
(count int)
| 332 | |
| 333 | // GetCursorRightPosition returns relative position for cursor right. |
| 334 | func (d *Document) GetCursorRightPosition(count int) int { |
| 335 | if count < 0 { |
| 336 | return d.GetCursorLeftPosition(-count) |
| 337 | } |
| 338 | if len(d.CurrentLineAfterCursor()) > count { |
| 339 | return count |
| 340 | } |
| 341 | return len(d.CurrentLineAfterCursor()) |
| 342 | } |
| 343 | |
| 344 | // GetCursorUpPosition return the relative cursor position (character index) where we would be |
| 345 | // if the user pressed the arrow-up button. |