From dee3218723b98176de95473a484fa0bf34a86d5d Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@posteo.de>
Date: Tue, 23 Feb 2021 17:10:48 +0100
Subject: [PATCH] Fix item selection with unavailable versions

Fixes #107
---
 app/ghcup/BrickMain.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/ghcup/BrickMain.hs b/app/ghcup/BrickMain.hs
index abfeeaab..80a96eff 100644
--- a/app/ghcup/BrickMain.hs
+++ b/app/ghcup/BrickMain.hs
@@ -153,7 +153,10 @@ ui dimAttrs BrickState { appSettings = as@(BrickSettings {}), ..}
           Nothing -> T.unpack . prettyVer $ lVer
           Just c  -> T.unpack (c <> "-" <> prettyVer lVer)
         dim
-          | lNoBindist = updateAttrMap (const dimAttrs) . withAttr "no-bindist"
+          | lNoBindist && (not lInstalled)
+            && (not b) -- TODO: overloading dim and active ignores active
+                       --       so we hack around it here
+          = updateAttrMap (const dimAttrs) . withAttr "no-bindist"
           | otherwise  = id
         hooray
           | elem Latest lTag && not lInstalled =
@@ -278,7 +281,7 @@ defaultAttributes no_color = attrMap
 dimAttributes :: Bool -> AttrMap
 dimAttributes no_color = attrMap
   (Vty.defAttr `Vty.withStyle` Vty.dim)
-  [ ("active"    , Vty.defAttr `withBackColor` Vty.blue)
+  [ ("active"    , Vty.defAttr `withBackColor` Vty.blue) -- has no effect ??
   , ("no-bindist", Vty.defAttr `Vty.withStyle` Vty.dim)
   ]
   where
-- 
GitLab