yi-core-0.14.0: Yi editor core library

LicenseGPL-2
Maintaineryi-devel@googlegroups.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
ExtensionsOverloadedStrings

Yi.String

Description

String manipulation utilities

Synopsis

Documentation

chomp :: String -> String -> String #

Remove any trailing strings matching irs (input record separator) from input string. Like perl's chomp(1).

dropSpace :: String -> String #

Trim spaces at beginning and end

fillText :: Int -> YiString -> [YiString] #

Fills lines up to the given length, splitting the text up if necessary.

mapLines :: (YiString -> YiString) -> YiString -> YiString #

A helper function for creating functions suitable for modifySelectionB and modifyRegionB. To be used when the desired function should map across the lines of a region.

lines' :: Text -> [Text] #

Split a Text in lines. Unlike lines, this does not remove any empty line at the end.

unlines' :: [Text] -> Text #

Inverse of lines'. In contrast to unlines, this does not add an empty line at the end.

commonTPrefix :: [Text] -> Maybe Text #

Works by resupplying the found prefix back into the list, eventually either finding the prefix or not matching.

commonTPrefix' :: [Text] -> Text #

Like commonTPrefix but returns empty text on failure.

listify :: [YiString] -> YiString #

This is kind of like the default Show instance for lists except over Text. It does not leave the elements in extra quotes and should not be attempted to be shown and read back.

showT :: Show a => a -> Text #

Helper that shows then packs the Text, for all those cases where we use show.

overInit :: (YiString -> YiString) -> YiString -> YiString #

overInit f runs f over the init of the input if possible, preserving the last element as-is. If given a string with length ≤ 1, it effectively does nothing.

Also see overTail.

overTail :: (YiString -> YiString) -> YiString -> YiString #

overInit f runs f over the tail of the input if possible, preserving the head element as-is. If given a string with length ≤ 1, it effectively does nothing.

Also see overInit.