yi-core-0.19.4: Yi editor core library

License | GPL-2
Maintainer | yi-devel@googlegroups.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Yi.Buffer

Description

The `Buffer` module defines monadic editing operations over one-dimensional buffers, maintaining a current point.

This module acts as a facade for the Buffer.* modules.

Synopsis

- module Yi.Buffer.Basic
- module Yi.Buffer.HighLevel
- module Yi.Buffer.Indent
- module Yi.Buffer.Misc
- module Yi.Buffer.Normal
- module Yi.Buffer.Region
- module Yi.Buffer.TextUnit
- module Yi.Buffer.Undo
- data UIUpdate
  - = TextUpdate !Update
  - | StyleUpdate !Point !Size
- data Update
  - = Insert {
    - updatePoint :: !Point
    - updateDirection :: !Direction
    - _insertUpdateString :: !YiString
    }
  - | Delete {
    - updatePoint :: !Point
    - updateDirection :: !Direction
    - _deleteUpdateString :: !YiString
    }
- updateIsDelete :: Update -> Bool
- markGravityAA :: Lens' MarkValue Direction
- markPointAA :: Lens' MarkValue Point

# Documentation

module Yi.Buffer.Basic

module Yi.Buffer.HighLevel

module Yi.Buffer.Indent

module Yi.Buffer.Misc

module Yi.Buffer.Normal

module Yi.Buffer.Region

module Yi.Buffer.TextUnit

module Yi.Buffer.Undo

data UIUpdate Source #

Constructors

TextUpdate !Update |
StyleUpdate !Point !Size |

#### Instances

Instances details

Binary UIUpdate Source # |
Instance details Defined in Yi.Buffer.Implementation Methods put :: UIUpdate -> Put Source # get :: Get UIUpdate Source # putList :: [UIUpdate] -> Put Source #
Generic UIUpdate Source # |

Instance details

Defined in Yi.Buffer.Implementation

Associated Types

type Rep UIUpdate |

Instance details

Defined in Yi.Buffer.Implementation

type Rep UIUpdate = D1 ('MetaData "UIUpdate" "Yi.Buffer.Implementation" "yi-core-0.19.4-4E7mid7TC5Y9v8ChZSA8gi" 'False) (C1 ('MetaCons "TextUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Update)) :+: C1 ('MetaCons "StyleUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size)))

Methods

from :: UIUpdate -> Rep UIUpdate x Source #

to :: Rep UIUpdate x -> UIUpdate Source #

type Rep UIUpdate Source # |

Instance details

Defined in Yi.Buffer.Implementation

type Rep UIUpdate = D1 ('MetaData "UIUpdate" "Yi.Buffer.Implementation" "yi-core-0.19.4-4E7mid7TC5Y9v8ChZSA8gi" 'False) (C1 ('MetaCons "TextUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Update)) :+: C1 ('MetaCons "StyleUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Size)))

data Update Source #

Mutation actions (also used the undo or redo list)

For the undoredo, we use the partial checkpoint/ (Berlage, pg16) strategy to store just the components of the state that change.

Note that the update direction is only a hint for moving the cursor (mainly for undo purposes); the insertions and deletions are always applied Forward.

Note that keeping the text does not cost much: we keep the updates in the undo list; if it's a Delete it means we have just inserted the text in the buffer, so the update shares the data with the buffer. If it's an Insert we have to keep the data any way.

Constructors

Insert |

Fields

- updatePoint :: !Point
- updateDirection :: !Direction
- _insertUpdateString :: !YiString

Delete |

Fields

- updatePoint :: !Point
- updateDirection :: !Direction
- _deleteUpdateString :: !YiString

#### Instances

Instances details

Binary Update Source # |
Instance details Defined in Yi.Buffer.Implementation Methods put :: Update -> Put Source # get :: Get Update Source # putList :: [Update] -> Put Source #
Generic Update Source # |

Instance details

Defined in Yi.Buffer.Implementation

Associated Types

type Rep Update |

Instance details

Defined in Yi.Buffer.Implementation

type Rep Update = D1 ('MetaData "Update" "Yi.Buffer.Implementation" "yi-core-0.19.4-4E7mid7TC5Y9v8ChZSA8gi" 'False) (C1 ('MetaCons "Insert" 'PrefixI 'True) (S1 ('MetaSel ('Just "updatePoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: (S1 ('MetaSel ('Just "updateDirection") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Direction) :*: S1 ('MetaSel ('Just "_insertUpdateString") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 YiString))) :+: C1 ('MetaCons "Delete" 'PrefixI 'True) (S1 ('MetaSel ('Just "updatePoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: (S1 ('MetaSel ('Just "updateDirection") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Direction) :*: S1 ('MetaSel ('Just "_deleteUpdateString") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 YiString))))

Methods

from :: Update -> Rep Update x Source #

to :: Rep Update x -> Update Source #

Show Update Source # |
Instance details Defined in Yi.Buffer.Implementation Methods showsPrec :: Int -> Update -> ShowS Source # show :: Update -> String Source # showList :: [Update] -> ShowS Source #
type Rep Update Source # |

Instance details

Defined in Yi.Buffer.Implementation

type Rep Update = D1 ('MetaData "Update" "Yi.Buffer.Implementation" "yi-core-0.19.4-4E7mid7TC5Y9v8ChZSA8gi" 'False) (C1 ('MetaCons "Insert" 'PrefixI 'True) (S1 ('MetaSel ('Just "updatePoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: (S1 ('MetaSel ('Just "updateDirection") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Direction) :*: S1 ('MetaSel ('Just "_insertUpdateString") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 YiString))) :+: C1 ('MetaCons "Delete" 'PrefixI 'True) (S1 ('MetaSel ('Just "updatePoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: (S1 ('MetaSel ('Just "updateDirection") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Direction) :*: S1 ('MetaSel ('Just "_deleteUpdateString") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 YiString))))

updateIsDelete :: Update -> Bool Source #

markGravityAA :: Lens' MarkValue Direction Source #

markPointAA :: Lens' MarkValue Point Source #