A bit more clean
This commit is contained in:
parent
262413cc69
commit
787222d067
@ -80,7 +80,7 @@ app :: App AppS e ()
|
||||
app =
|
||||
App { appDraw = pure . browse
|
||||
, appHandleEvent = eventHandler
|
||||
, appStartEvent = pure ()
|
||||
, appStartEvent = put =<< liftIO . changeDir =<< get
|
||||
, appAttrMap = attributeMap
|
||||
, appChooseCursor = showFirstCursor
|
||||
}
|
||||
@ -174,7 +174,7 @@ scroll d s = s {
|
||||
case d of
|
||||
SUp -> (-1)
|
||||
SDown -> 1
|
||||
newCursor = max 0 (min (subtract 1 . length $ appSubFiles s) cursor)
|
||||
newCursor = clamp 0 (subtract 1 . length $ appSubFiles s) cursor
|
||||
maybeNewPath = fst <$> appSubFiles s !? newCursor
|
||||
|
||||
eventHandler :: BrickEvent () e -> EventM () AppS ()
|
||||
@ -219,6 +219,5 @@ main :: IO ()
|
||||
main = do
|
||||
a <- getWorkingDirectory
|
||||
b <- newIORef =<< empty
|
||||
c <- changeDir $ initialState a b
|
||||
_ <- defaultMain app c
|
||||
_ <- defaultMain app $ initialState a b
|
||||
return ()
|
||||
|
Loading…
Reference in New Issue
Block a user