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
Extensions | FlexibleContexts

Yi.UI.Utils

Description

Utilities shared by various UIs

Synopsis

- applyHeights :: Traversable t => [Int] -> t Window -> t Window
- spliceAnnots :: [(Point, Char)] -> [Span String] -> [(Point, Char)]
- strokePicture :: [Span (Endo a)] -> [(Point, a -> a)]
- paintStrokes :: (a -> a) -> a -> [(Point, a -> a)] -> [(Point, a)] -> [(Point, a)]
- paintPicture :: a -> [[Span (Endo a)]] -> [(Point, a)]
- attributesPictureB :: UIStyle -> Maybe SearchExp -> Region -> [[Span StyleName]] -> BufferM [(Point, Attributes)]
- attributesPictureAndSelB :: UIStyle -> Maybe SearchExp -> Region -> BufferM [(Point, Attributes)]
- arrangeItems :: [Text] -> Int -> Int -> [Text]
- arrangeItems' :: [Text] -> Int -> Int -> (Int, [Text])

# Documentation

applyHeights :: Traversable t => [Int] -> t Window -> t Window Source #

spliceAnnots :: [(Point, Char)] -> [Span String] -> [(Point, Char)] Source #

strokePicture :: [Span (Endo a)] -> [(Point, a -> a)] Source #

Turn a sequence of (from,style,to) strokes into a sequence of picture points (from,style), taking special care to ensure that the points are strictly increasing and introducing padding segments where necessary. Precondition: Strokes are ordered and not overlapping.

paintStrokes :: (a -> a) -> a -> [(Point, a -> a)] -> [(Point, a)] -> [(Point, a)] Source #

Paint the given stroke-picture on top of an existing picture

paintPicture :: a -> [[Span (Endo a)]] -> [(Point, a)] Source #

attributesPictureB :: UIStyle -> Maybe SearchExp -> Region -> [[Span StyleName]] -> BufferM [(Point, Attributes)] Source #

attributesPictureAndSelB :: UIStyle -> Maybe SearchExp -> Region -> BufferM [(Point, Attributes)] Source #

arrangeItems :: [Text] -> Int -> Int -> [Text] Source #

Arrange a list of items in columns over maximum `maxNumberOfLines` lines

arrangeItems' :: [Text] -> Int -> Int -> (Int, [Text]) Source #

Arrange a list of items in columns over `numberOfLines` lines.

TODO: proper Text/YiString implementation