Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data RopeZipper = RopeZipper {
- linesBefore :: !Rope
- currentLine :: !TextZipper
- linesAfter :: !Rope
- stickyCol :: !Position
- data Position = Position {}
- null :: RopeZipper -> Bool
- cursor :: RopeZipper -> Position
- moveCursor :: (Position -> Position) -> RopeZipper -> RopeZipper
- setCursor :: Position -> RopeZipper -> RopeZipper
- lines :: RopeZipper -> [Text]
- lengthInLines :: RopeZipper -> Word
- toRope :: RopeZipper -> Rope
- toText :: RopeZipper -> Text
- fromParts :: Rope -> Rope -> RopeZipper
- fromRope :: Rope -> RopeZipper
- fromText :: Text -> RopeZipper
- splitFirstLine :: Rope -> (Text, Rope)
- splitLastLine :: Rope -> (Rope, Text)
- insertRope :: Rope -> RopeZipper -> RopeZipper
- insertText :: Text -> RopeZipper -> RopeZipper
- insertChar :: Char -> RopeZipper -> RopeZipper
- deleteBefore :: RopeZipper -> RopeZipper
- deleteAfter :: RopeZipper -> RopeZipper
- moveForward :: RopeZipper -> RopeZipper
- moveBackward :: RopeZipper -> RopeZipper
- moveUp :: RopeZipper -> RopeZipper
- moveDown :: RopeZipper -> RopeZipper
- moveToLineStart :: RopeZipper -> RopeZipper
- moveToLineEnd :: RopeZipper -> RopeZipper
- moveToFirstLine :: RopeZipper -> RopeZipper
- moveToLastLine :: RopeZipper -> RopeZipper
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
.
RopeZipper | |
|
Instances
Represent a position in a text.
Instances
Monoid Position | |
Semigroup Position | Associativity does not hold when |
Show Position | |
NFData Position | |
Defined in Data.Text.Lines.Internal | |
Eq Position | |
Ord Position | |
Defined in Data.Text.Lines.Internal | |
HasField "cursor" RopeZipper Position Source # | |
Defined in Data.Text.Rope.Zipper getField :: RopeZipper -> Position # |
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.
lines :: RopeZipper -> [Text] Source #
lengthInLines :: RopeZipper -> Word Source #
toRope :: RopeZipper -> Rope Source #
toText :: RopeZipper -> Text Source #
fromRope :: Rope -> RopeZipper Source #
fromText :: Text -> RopeZipper Source #
insertRope :: Rope -> RopeZipper -> RopeZipper Source #
insertText :: Text -> RopeZipper -> RopeZipper Source #
insertChar :: Char -> RopeZipper -> RopeZipper Source #
deleteBefore :: RopeZipper -> RopeZipper Source #
deleteAfter :: RopeZipper -> RopeZipper Source #
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.