Cursor
Inherits Comparable < Reference < Object
Represents a cursor in the editor. Appearance is managed here too.
Cursor is not yet self-sufficient. You must use Selection
to have complete editing capabilities.
Constructors
Instance methods
Two cursors are equal when their indices are equal.
Returns whether this cursor is located after the last character in the document.
Returns whether this cursor is located before the first character in the document.
Moves ("teleports") other cursor to this cursor.
See seek to learn what settings are.
Returns the column (offset from line start) of this cursor. Columns are counted starting from zero!
Yields Lines starting from this cursor's line up to
other's line.
Two cursors are equal when their indices are equal.
Returns a tuple with this and other cursor sorted in ascending order (minimum to maximum, aka leftmost to rightmost).
Increments this cursor's index by delta.
That is, if delta is negative, this cursor will move that many characters to the left; if it is positive, this cursor will move that many characters to the right.
If delta is zero, simply refreshes this cursor's X, Y position in document.
See seek to learn what settings are.
Returns self.
Returns whether the range starting from this cursor, and up to other cursor, is partially or completely visible.
Returns whether the range starting from the given start index, and up to this cursor, is partially or completely visible.
Moves ("teleports") this cursor to other cursor.
See seek to learn what settings are.
Moves this cursor to index.
settings specify how this method should seek index.
See SeekSettings for the available settings.
Returns self.
Moves this cursor to the given column.
See seek to learn what settings are.
Moves this cursor to the end of its line.
See seek to learn what settings are.
Moves this cursor to the beginning of its line.
See seek to learn what settings are.
Builds and returns a Span starting from this cursor up
to other cursor (based on indices of both). Order matters!
This cursor's index must be smaller than that of other.
Builds and returns a Span starting from start up to
this cursor. Order matters! This cursor's index must be
greater than start.
Increments this cursor's line number by delta.
That is, if delta is negative, this cursor will move that many lines up; if it is positive, this cursor will move that many lines down.
If unable to move because the cursor is already at the top or bottom line of the document, moves to the first or last character in the document, respectively.
See seek to learn what settings are.
Returns self.