text-rope-zipper-0.1.0.0: 2D text zipper based on text-rope
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Text.Rope.Zipper

Synopsis

Documentation

data RopeZipper Source #

A RopeZipper is similar in concept to a TextZipper, but tracks the lines before the cursor, lines after the cursor, and the current line of the cursor (as a TextZipper). In essence, it is a 2D extension of TextZipper.

Constructors

RopeZipper 

Fields

Instances

Instances details
IsString RopeZipper Source # 
Instance details

Defined in Data.Text.Rope.Zipper

Monoid RopeZipper Source # 
Instance details

Defined in Data.Text.Rope.Zipper

Semigroup RopeZipper Source #

(<>) appends the content of the second zipper after the first; the cursor of the first is preserved while the cursor of the second is ignored.

Instance details

Defined in Data.Text.Rope.Zipper

Generic RopeZipper Source # 
Instance details

Defined in Data.Text.Rope.Zipper

Associated Types

type Rep RopeZipper :: Type -> Type #

Show RopeZipper Source # 
Instance details

Defined in Data.Text.Rope.Zipper

Eq RopeZipper Source # 
Instance details

Defined in Data.Text.Rope.Zipper

HasField "cursor" RopeZipper Position Source # 
Instance details

Defined in Data.Text.Rope.Zipper

type Rep RopeZipper Source # 
Instance details

Defined in Data.Text.Rope.Zipper

type Rep RopeZipper = D1 ('MetaData "RopeZipper" "Data.Text.Rope.Zipper" "text-rope-zipper-0.1.0.0-IuZC36hr3pjD5Fa3aYOd9b" 'False) (C1 ('MetaCons "RopeZipper" 'PrefixI 'True) ((S1 ('MetaSel ('Just "linesBefore") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rope) :*: S1 ('MetaSel ('Just "currentLine") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TextZipper)) :*: (S1 ('MetaSel ('Just "linesAfter") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rope) :*: S1 ('MetaSel ('Just "stickyCol") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Position))))

data Position #

Represent a position in a text.

Constructors

Position 

Fields

Instances

Instances details
Monoid Position 
Instance details

Defined in Data.Text.Lines.Internal

Semigroup Position

Associativity does not hold when posLine overflows.

Instance details

Defined in Data.Text.Lines.Internal

Show Position 
Instance details

Defined in Data.Text.Lines.Internal

NFData Position 
Instance details

Defined in Data.Text.Lines.Internal

Methods

rnf :: Position -> () #

Eq Position 
Instance details

Defined in Data.Text.Lines.Internal

Ord Position 
Instance details

Defined in Data.Text.Lines.Internal

HasField "cursor" RopeZipper Position Source # 
Instance details

Defined in Data.Text.Rope.Zipper

null :: RopeZipper -> Bool Source #

Whether the whole RopeZipper structure is empty.

cursor :: RopeZipper -> Position Source #

Get the current cursor position of the RopeZipper.

moveCursor :: (Position -> Position) -> RopeZipper -> RopeZipper Source #

Move the cursor relative to its current position.

setCursor :: Position -> RopeZipper -> RopeZipper Source #

Move the cursor to the given absolute position.

moveForward :: RopeZipper -> RopeZipper Source #

Move the cursor to the next character of the current line, if there is one. Does not change lines.

moveBackward :: RopeZipper -> RopeZipper Source #

Move the cursor to the previous character of the current row, if there is one. Does not change lines.

moveUp :: RopeZipper -> RopeZipper Source #

Move the cursor to the previous line, trying to preserve the column.

moveDown :: RopeZipper -> RopeZipper Source #

Move the cursor to the next line, trying to preserve the column.

moveToLineStart :: RopeZipper -> RopeZipper Source #

Move the cursor to the start of the current line.

moveToLineEnd :: RopeZipper -> RopeZipper Source #

Move the cursor to the end of the current line.

moveToFirstLine :: RopeZipper -> RopeZipper Source #

Move the cursor to the first line, trying to preserve the column.

moveToLastLine :: RopeZipper -> RopeZipper Source #

Move the cursor to the last line, trying to preserve the column.