| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Text.Region
- pt :: Int -> Int -> Point
- start :: Point
- lineStart :: Int -> Point
- regionLength :: Lens' Region Size
- till :: Point -> Point -> Region
- linesSize :: Int -> Size
- regionLines :: Lens' Region Int
- emptyRegion :: Region -> Bool
- line :: Int -> Region
- regionSize :: Point -> Size -> Region
- expandLines :: Region -> Region
- atRegion :: Editable s => Region -> Lens' (Contents s) (Contents s)
- overlaps :: Region -> Region -> Bool
- applyMap :: Map -> Region -> Region
- cutMap :: Region -> Map
- insertMap :: Region -> Map
- cutRegion :: Region -> Region -> Region
- insertRegion :: Region -> Region -> Region
- class Editable s => EditAction e s where
- cut :: EditAction e s => Region -> e s
- paste :: EditAction e s => Point -> Contents s -> e s
- overwrite :: EditAction e s => Point -> Contents s -> e s
- apply :: Editable s => Edit s -> Contents s -> Contents s
- update :: Editable s => Edit s -> Region -> Region
- module Data.Text.Region.Types
Documentation
line :: Int -> Region Source #
n'th line region, starts at the beginning of line and ends on the next line
insertRegion :: Region -> Region -> Region Source #
Update second region position as if it was data inserted at first region (region sets insertion point and data size) Region tries not to extend if data inserted at region bound except when region is empty This allows define replace as cut and insert in special case when we replace region itself
class Editable s => EditAction e s where Source #
Methods
replace :: Region -> Contents s -> e s Source #
actionMap :: e s -> Map Source #
Make Map from action
perform :: e s -> Contents s -> Contents s Source #
Perform action, modifying Contents
inversed :: e s -> Contents s -> e s Source #
Get action undo
Instances
| Editable s => EditAction Replace s Source # | |
| Editable s => EditAction Edit s Source # | |
cut :: EditAction e s => Region -> e s Source #
Cuts region
module Data.Text.Region.Types