| 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
- replace :: EditAction e s => Region -> s -> e s
- cut :: EditAction e s => Region -> e s
- paste :: EditAction e s => Point -> s -> e s
- overwrite :: EditAction e s => Point -> s -> e s
- apply :: Editable s => Edit s -> s -> s
- update :: (Editable s, Regioned r) => Edit s -> r -> r
- undo :: Editable s => Edit s -> s -> Edit s
- module Data.Text.Region.Types
Documentation
regionLength :: Lens' Region Size #
Regions length
regionLines :: Lens' Region Int #
emptyRegion :: Region -> Bool #
Is Region empty
expandLines :: Region -> Region #
Expand Region to contain full lines
insertRegion :: Region -> Region -> Region #
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 #
Minimal complete definition
Methods
replaceAction :: Region -> Contents s -> e s #
Make Map from action
perform :: e s -> Contents s -> Contents s #
Perform action, modifying Contents
inversed :: e s -> Contents s -> e s #
Get action undo
Instances
| Editable s => EditAction Replace s # | |
| Editable s => EditAction Edit s # | |
replace :: EditAction e s => Region -> s -> e s #
Replace region with data
cut :: EditAction e s => Region -> e s #
Cuts region
module Data.Text.Region.Types