1{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE LambdaCase #-}
4{-# LANGUAGE OverloadedStrings #-}
5{-# LANGUAGE RankNTypes #-}
6{-# LANGUAGE ScopedTypeVariables #-}
7{-# OPTIONS_GHC -threaded #-}
9import Control.Monad.Fix
10import qualified Data.Text as T
11import qualified Graphics.Vty as V
19 tellShutdown . fforMaybe inp $ \case
20 V.EvKey V.KEsc _ -> Just ()
27testBoxes :: (Reflex t, MonadHold t m, MonadFix m) => VtyWidget t m ()
30 let region1 = fmap (\(w,h) -> Region (w `div` 6) (h `div` 6) (w `div` 2) (h `div` 2)) size
31 region2 = fmap (\(w,h) -> Region (w `div` 4) (h `div` 4) (2 * (w `div` 3)) (2*(h `div` 3))) size
32 pane region1 (constDyn False) . box singleBoxStyle $ debugInput
33 _ <- pane region2 (constDyn True) . box singleBoxStyle $
34 splitVDrag (hRule doubleBoxStyle) (box roundedBoxStyle $ multilineTextInput def) (box roundedBoxStyle dragTest)
37debugFocus :: (Reflex t, Monad m) => VtyWidget t m ()
40 text $ T.pack . show <$> current f
42debugInput :: (Reflex t, MonadHold t m) => VtyWidget t m ()
44 lastEvent <- hold "No event yet" . fmap show =<< input
45 text $ T.pack <$> lastEvent
47dragTest :: (Reflex t, MonadHold t m, MonadFix m) => VtyWidget t m ()
49 lastEvent <- hold "No event yet" . fmap show =<< drag V.BLeft
50 text $ T.pack <$> lastEvent
52testStringBox :: (Reflex t, Monad m) => VtyWidget t m ()
53testStringBox = box singleBoxStyle .
54 text . pure . T.pack . take 500 $ cycle ('\n' : ['a'..'z'])
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list