Philtre.Editor.Block.Selection (philtre v0.9.1)
Holds current selection in a block.
Passed from client to backend and vice-versa when executing block commands.
The ids are ids of cells in which a selection starts or ends. The offests are indices within those cells where the selection starts or ends.
That means a simple caret (a cursor somewhere in the block text) will have the same ids and same offsets.
Similarly, a selection of a text within a single cell will have the same ids, but different offsets.
Lastly, a selection across cells within a block will have different ids and different offsets.
Selection across blocks is not possible. Only whole blocks can be selected and this is handled at a different level.
Link to this section Summary
Link to this section Types
@type t() :: %Philtre.Editor.Block.Selection{ end_id: Philtre.Editor.Block.Cell.id() | nil, end_offset: non_neg_integer() | nil, start_id: Philtre.Editor.Block.Cell.id() | nil, start_offset: non_neg_integer() | nil }
Link to this section Functions
Link to this function
new_empty()
Link to this function
new_end_of(cell)
Link to this function
new_start_of(cell)
Link to this function