struct CharStep
- CharStep
- Struct
- Value
- Object
Overview
The default kind of cursor step. Advances the cursor to the speculative next character, meaning it's character-by-character, without-any-state-nor-thought kind of movement.
Included Modules
Defined in:
aspis/step.crConstructors
Instance Method Summary
-
#advance(document : Document, prev : Int, nxt : Int) : Int
Returns the next cursor index.
- #initialize
Instance methods inherited from module CursorStep
advance(document : Document, prev : Int, nxt : Int) : Int
advance
Constructor Detail
Instance Method Detail
Description copied from module CursorStep
Returns the next cursor index.
prev and nxt are indices belonging to document.
prev index is the previous index (where motion started).
nxt index is the speculative, character-based next index. It might be out of document's bounds.
The latter is usually the index you'd need to change/snap,
as a CursorStep
implementor. The former is given to you
so you can e.g. compute delta or determine the direction
of the movement.
The returned index must be in bounds of the document.