Clean up using hlint and --pedantic

This commit is contained in:
Joscha 2018-09-16 16:30:41 +00:00
parent 89248a34d1
commit b524441d9c
7 changed files with 62 additions and 41 deletions

View file

@ -1,14 +1,15 @@
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
module TaskMachine.UI.TaskList where
import qualified Brick as B
import qualified Brick.Widgets.Edit as B
import TaskMachine.LTask
import TaskMachine.Todotxt
import TaskMachine.UI.Types
{-
widgetPriority :: B.AttrName -> Maybe Priority -> B.Widget n
widgetPriority _ Nothing = B.emptyWidget
widgetPriority highlight (Just prio) =
@ -28,3 +29,12 @@ renderLTask highlight (LTask _ Task{..}) =
wPriority = widgetPriority attrHighlight taskPriority
wDescription = widgetDescription attrHighlight taskDescription
in B.hBox [wCompleted, wPriority, wDescription]
-}
renderLTask :: Maybe (B.Editor String RName) -> Bool -> LTask -> B.Widget RName
renderLTask _ False (LTask _ t) = B.withAttr normal $ B.str $ formatTask t
where normal = "normal" <> "priority"
renderLTask Nothing True (LTask _ t) = B.withAttr highlight $ B.str $ formatTask t
where highlight = "highlight" <> "priority"
renderLTask (Just edit) True _ = B.withAttr highlight $ B.renderEditor (B.str . unlines) True edit
where highlight = "highlight" <> "priority"