Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cursor.Text
Synopsis
- newtype TextCursor = TextCursor {}
- emptyTextCursor :: TextCursor
- makeTextCursor :: Text -> Maybe TextCursor
- makeTextCursorWithSelection :: Int -> Text -> Maybe TextCursor
- rebuildTextCursor :: TextCursor -> Text
- textCursorNull :: TextCursor -> Bool
- textCursorLength :: TextCursor -> Int
- textCursorIndex :: TextCursor -> Int
- textCursorSelectPrev :: TextCursor -> Maybe TextCursor
- textCursorSelectNext :: TextCursor -> Maybe TextCursor
- textCursorSelectIndex :: Int -> TextCursor -> TextCursor
- textCursorSelectStart :: TextCursor -> TextCursor
- textCursorSelectEnd :: TextCursor -> TextCursor
- textCursorPrevChar :: TextCursor -> Maybe Char
- textCursorNextChar :: TextCursor -> Maybe Char
- textCursorSelectBeginWord :: TextCursor -> TextCursor
- textCursorSelectEndWord :: TextCursor -> TextCursor
- textCursorSelectNextWord :: TextCursor -> TextCursor
- textCursorSelectPrevWord :: TextCursor -> TextCursor
- textCursorInsert :: Char -> TextCursor -> Maybe TextCursor
- textCursorAppend :: Char -> TextCursor -> Maybe TextCursor
- textCursorInsertString :: String -> TextCursor -> Maybe TextCursor
- textCursorAppendString :: String -> TextCursor -> Maybe TextCursor
- textCursorInsertText :: Text -> TextCursor -> Maybe TextCursor
- textCursorAppendText :: Text -> TextCursor -> Maybe TextCursor
- textCursorRemove :: TextCursor -> Maybe (DeleteOrUpdate TextCursor)
- textCursorDelete :: TextCursor -> Maybe (DeleteOrUpdate TextCursor)
- textCursorSplit :: TextCursor -> (TextCursor, TextCursor)
- textCursorCombine :: TextCursor -> TextCursor -> TextCursor
Documentation
newtype TextCursor Source #
A cursor for single-line texts
Constructors
TextCursor | |
Fields |
Instances
Eq TextCursor Source # | |
Defined in Cursor.Text | |
Show TextCursor Source # | |
Defined in Cursor.Text Methods showsPrec :: Int -> TextCursor -> ShowS # show :: TextCursor -> String # showList :: [TextCursor] -> ShowS # | |
Generic TextCursor Source # | |
Defined in Cursor.Text Associated Types type Rep TextCursor :: Type -> Type # | |
NFData TextCursor Source # | |
Defined in Cursor.Text Methods rnf :: TextCursor -> () # | |
Validity TextCursor Source # | |
Defined in Cursor.Text Methods validate :: TextCursor -> Validation # | |
type Rep TextCursor Source # | |
Defined in Cursor.Text type Rep TextCursor = D1 ('MetaData "TextCursor" "Cursor.Text" "cursor-0.3.2.0-Ch3lJwc3yY89mrJgbt03T" 'True) (C1 ('MetaCons "TextCursor" 'PrefixI 'True) (S1 ('MetaSel ('Just "textCursorList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListCursor Char)))) |
makeTextCursor :: Text -> Maybe TextCursor Source #
makeTextCursorWithSelection :: Int -> Text -> Maybe TextCursor Source #
rebuildTextCursor :: TextCursor -> Text Source #
textCursorNull :: TextCursor -> Bool Source #
textCursorLength :: TextCursor -> Int Source #
textCursorIndex :: TextCursor -> Int Source #
textCursorSelectIndex :: Int -> TextCursor -> TextCursor Source #
textCursorPrevChar :: TextCursor -> Maybe Char Source #
textCursorNextChar :: TextCursor -> Maybe Char Source #
textCursorSelectBeginWord :: TextCursor -> TextCursor Source #
Move to the beginning of the word
"hell|o"
->"|hello"
"hello | world"
->"|hello world"
"hello |world"
->"hello |world"
"| hello"
->"| hello"
textCursorSelectEndWord :: TextCursor -> TextCursor Source #
Move to the end of the word
"hell|o"
->"hello|"
"hello | world"
->"hello world|"
"hello| world"
->"hello| world"
"hello |"
->"hello |"
textCursorSelectNextWord :: TextCursor -> TextCursor Source #
Move to the beginning of the next word
"|hello"
->"hello|"
"hell|o world"
->"hello |world"
"hello| world"
->"hello |world"
"hello |"
->"hello |"
textCursorSelectPrevWord :: TextCursor -> TextCursor Source #
Move to the end of the previous word
"hello|"
->"|hello"
"hello w|orld"
->"hello| world"
"hello |world"
->"hello| world"
" h|ello"
->"| hello"
textCursorInsert :: Char -> TextCursor -> Maybe TextCursor Source #
textCursorAppend :: Char -> TextCursor -> Maybe TextCursor Source #
textCursorInsertString :: String -> TextCursor -> Maybe TextCursor Source #
textCursorAppendString :: String -> TextCursor -> Maybe TextCursor Source #
textCursorInsertText :: Text -> TextCursor -> Maybe TextCursor Source #
textCursorAppendText :: Text -> TextCursor -> Maybe TextCursor Source #
textCursorSplit :: TextCursor -> (TextCursor, TextCursor) Source #
textCursorCombine :: TextCursor -> TextCursor -> TextCursor Source #