Copyright | (C) 2019 QBayLogic |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Orestis Melkonian <melkon.or@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Basic functionality for the terminal user-inteface (TUI).
Synopsis
- runTerminal :: forall term. Diff term => FilePath -> IO ()
- app :: Diff term => AttrMap -> App (VizStates term) NoCustomEvent Name
- chooseCursor :: VizStates term -> [Cursor] -> Maybe Cursor
- drawUI :: forall term. Diff term => VizStates term -> [Widget Name]
- lookupSize :: EventM Name (VizStates term -> VizStates term)
- updateOcc :: Diff term => VizStates term -> VizStates term
- handleStart :: forall term. Diff term => VizStates term -> BrickEvent Name NoCustomEvent -> EventM Name (Next (VizStates term))
- handleEvent :: Diff term => VizStates term -> BrickEvent Name NoCustomEvent -> EventM Name (Next (VizStates term))
- scrollStep :: Int
- l :: ViewportScroll Name
- r :: ViewportScroll Name
- vScrollL :: EventM Name ()
- vScrollR :: EventM Name ()
- hScrollL :: EventM Name ()
- hScrollR :: EventM Name ()
- vScrollL' :: EventM Name ()
- vScrollR' :: EventM Name ()
- hScrollL' :: EventM Name ()
- hScrollR' :: EventM Name ()
- vScrollHomeL :: EventM Name ()
- vScrollHomeR :: EventM Name ()
- vScrollEndL :: EventM Name ()
- vScrollEndR :: EventM Name ()
- visibleCursors :: Int -> Widget Name -> Widget Name
- invisibleCursors :: Widget n -> Widget n
Documentation
app :: Diff term => AttrMap -> App (VizStates term) NoCustomEvent Name Source #
The App
configuration.
chooseCursor :: VizStates term -> [Cursor] -> Maybe Cursor Source #
Choose a single cursor to display, out of possibly many requests.
Display.
Event handling.
lookupSize :: EventM Name (VizStates term -> VizStates term) Source #
Lookup terminal size and store in the current state.
updateOcc :: Diff term => VizStates term -> VizStates term Source #
Update number of occurrences of searched string in both viewports.
handleStart :: forall term. Diff term => VizStates term -> BrickEvent Name NoCustomEvent -> EventM Name (Next (VizStates term)) Source #
Lookup code sizes and store them in the current state, then handle events.
handleEvent :: Diff term => VizStates term -> BrickEvent Name NoCustomEvent -> EventM Name (Next (VizStates term)) Source #
Handle keyboard events.
Scrolling.
scrollStep :: Int Source #
The amount of scrolling with each request (in pixels).
l :: ViewportScroll Name Source #
r :: ViewportScroll Name Source #
vScrollHomeL :: EventM Name () Source #
vScrollHomeR :: EventM Name () Source #
vScrollEndL :: EventM Name () Source #
vScrollEndR :: EventM Name () Source #
visibleCursors :: Int -> Widget Name -> Widget Name Source #
Gather all cursor placement requests coming from within the given Widget
,
filter out only those that are the result of a search command,
and convert the current one (based on the current occurrence number)
to a visibility request.
NB: Only to be used within a viewport
.
invisibleCursors :: Widget n -> Widget n Source #
Remove all cursor placement requests coming from within the given Widget
.
NB: Only to be used within a viewport
.