ot-0.2.0.0: Real-time collaborative editing with Operational Transformation

Safe HaskellNone
LanguageHaskell98

Control.OperationalTransformation.Selection

Synopsis

Documentation

data Range Source

Range has anchor and head properties, which are zero-based indices into the document. The anchor is the side of the selection that stays fixed, head is the side of the selection where the cursor is. When both are equal, the range represents a cursor.

Constructors

Range 

Fields

rangeAnchor :: !Int
 
rangeHead :: !Int
 

newtype Selection Source

 A selection consists of a list of ranges. Each range may represent a selected part of the document or a cursor in the document.

Constructors

Selection 

Fields

ranges :: [Range]
 

createCursor :: Int -> Selection Source

Create a selection that represents a cursor.

size :: Selection -> Int Source

Number of selected characters

somethingSelected :: Selection -> Bool Source

Does the selection contain any characters?