Offset one unit to the left (direction -1) or right (1) of from.
- edit: the text being edited.
- from: the byte offset to start from.
- unit: how far to go.
- direction: -1 for left, 1 for right.
offset_by :: (edit: *Text_Edit, from: int, unit: Unit, direction: int) -> int
Offset one unit to the left (direction -1) or right (1) of from.
Parameters
- edit: *Text_Edit
- the text being edited.
- from: int
- the byte offset to start from.
- unit: Unit
- how far to go.
- direction: int
- -1 for left, 1 for right.
Returns
- int