Copyright | (C) 2019 QBayLogic |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Orestis Melkonian <melkon.or@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Pretty-printing utilities and styling for the TUI.
Synopsis
- countOcc :: forall term. Diff term => Options term -> String -> term -> Int
- showCode :: forall term. Diff term => Bool -> Int -> Options term -> [Ctx term] -> String -> term -> Widget Name
- data MyDoc
- data Item
- myForm :: forall term. Diff term => [Ctx term] -> SimpleDocStream (Ann term) -> [MyDoc]
- split :: [MyDoc] -> [(Int, [MyDoc])]
- render :: Bool -> String -> Int -> (Int, [MyDoc]) -> Widget Name
- defaultTheme :: [(String, Attr)] -> Theme
- modify :: Bool -> [String] -> Widget n -> Widget n
- highlightSearch :: Int -> String -> String -> (Widget Name, Int)
- emph :: String -> Widget n
- title :: String -> Widget n
- withBorder :: String -> Widget n -> Widget n
- withBorderSelected :: String -> Widget n -> Widget n
- withBorderStyle :: BorderStyle -> String -> Widget n -> Widget n
- fillSize :: Int -> String -> String
- vBoxSpaced :: [Widget n] -> Widget n
- hBoxSpaced :: Int -> [Widget n] -> Widget n
Rendering.
:: Diff term | |
=> Options term | options for Clash's pretty-printer |
-> String | the string to search for |
-> term | code to search in |
-> Int | total number of occurrences |
Count number of occurrences of a given search string in a given expression.
:: Diff term | |
=> Bool | whether to scroll to focused region |
-> Int | maximum line width |
-> Options term | options for Clash's pretty-printer |
-> [Ctx term] | the current context |
-> String | the string to search for |
-> term | code to display |
-> Widget Name | the Brick widget to display |
Render the given expression as a Widget
.
A simpler document type, specific to our use-case.
myForm :: forall term. Diff term => [Ctx term] -> SimpleDocStream (Ann term) -> [MyDoc] Source #
Convert a document stream into our simpler data type.
render :: Bool -> String -> Int -> (Int, [MyDoc]) -> Widget Name Source #
Render a single line in Brick (highlighting when marked).
Styling.
modify :: Bool -> [String] -> Widget n -> Widget n Source #
Add a list of stylistic modifications to a Widget
.
:: Int | occurrences so far |
-> String | the whole string (haystack) |
-> String | the string to search for (needle) |
-> (Widget Name, Int) |
Highlight searched occurrences inside the given Widget
.
withBorder :: String -> Widget n -> Widget n Source #
Render a given widget inside a box with unicode border.
withBorderSelected :: String -> Widget n -> Widget n Source #
Render a given widget inside a box with unicode and bold border.
withBorderStyle :: BorderStyle -> String -> Widget n -> Widget n Source #
Render given Widget
inside a box with the given title and border style.