From 04b29b0b987190a0b1156f2872143a8d5062eacb Mon Sep 17 00:00:00 2001 From: Luis Morillo Date: Sat, 16 Mar 2024 16:27:04 +0100 Subject: [PATCH] fix regression #875 and build system --- lib-tui/GHCup/Brick/App.hs | 4 ++-- lib-tui/GHCup/Brick/Widgets/Menus/CompileGHC.hs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib-tui/GHCup/Brick/App.hs b/lib-tui/GHCup/Brick/App.hs index bde89e8..4507b1b 100644 --- a/lib-tui/GHCup/Brick/App.hs +++ b/lib-tui/GHCup/Brick/App.hs @@ -118,8 +118,8 @@ navigationHandler :: BrickEvent Name e -> EventM Name BrickState () navigationHandler ev = do AppState { keyBindings = kb } <- liftIO $ readIORef Actions.settings' case ev of - inner_event@(VtyEvent (Vty.EvKey key _)) -> - case find (\(key', _, _) -> key' == KeyCombination key []) (Actions.keyHandlers kb) of + inner_event@(VtyEvent (Vty.EvKey key mods)) -> + case find (\(key', _, _) -> key' == KeyCombination key mods) (Actions.keyHandlers kb) of Just (_, _, handler) -> handler Nothing -> void $ Common.zoom appState $ Navigation.handler inner_event inner_event -> Common.zoom appState $ Navigation.handler inner_event diff --git a/lib-tui/GHCup/Brick/Widgets/Menus/CompileGHC.hs b/lib-tui/GHCup/Brick/Widgets/Menus/CompileGHC.hs index 0acc182..f6ab76b 100644 --- a/lib-tui/GHCup/Brick/Widgets/Menus/CompileGHC.hs +++ b/lib-tui/GHCup/Brick/Widgets/Menus/CompileGHC.hs @@ -44,7 +44,7 @@ import Prelude hiding ( appendFile ) import Optics.TH (makeLenses) import qualified GHCup.Brick.Common as Common import GHCup.Types - ( KeyCombination, BuildSystem(Hadrian), VersionPattern ) + ( KeyCombination, BuildSystem(..), VersionPattern ) import URI.ByteString (URI) import qualified Data.Text as T import qualified Data.ByteString.UTF8 as UTF8 @@ -152,7 +152,7 @@ create k = Menu.createMenu CompileGHCBox initialState k buttons fields where readSys i | T.toLower i == "hadrian" = Right $ Just Hadrian - | T.toLower i == "make" = Right $ Just Hadrian + | T.toLower i == "make" = Right $ Just Make | otherwise = Left "Not a valid Build System" fields = @@ -181,11 +181,11 @@ create k = Menu.createMenu CompileGHCBox initialState k buttons fields , Menu.createEditableField (Common.MenuElement Common.OvewrwiteVerEditBox) versionV overwriteVer & Menu.fieldLabelL .~ "overwrite-version" & Menu.fieldHelpMsgL .~ "Allows to overwrite the finally installed VERSION with a different one" - , Menu.createEditableField (Common.MenuElement Common.BuildFlavourEditBox) (Right . Just . T.unpack) buildFlavour - & Menu.fieldLabelL .~ "flavour" - & Menu.fieldHelpMsgL .~ "Set the compile build flavour (this value depends on the build system type: 'make' vs 'hadrian')" , Menu.createEditableField (Common.MenuElement Common.BuildSystemEditBox) systemV buildSystem & Menu.fieldLabelL .~ "build system" + & Menu.fieldHelpMsgL .~ "either 'make' or 'hadrian'" + , Menu.createEditableField (Common.MenuElement Common.BuildFlavourEditBox) (Right . Just . T.unpack) buildFlavour + & Menu.fieldLabelL .~ "flavour" & Menu.fieldHelpMsgL .~ "Set the compile build flavour (this value depends on the build system type: 'make' vs 'hadrian')" , Menu.createEditableField (Common.MenuElement Common.IsolateEditBox) filepathV isolateDir & Menu.fieldLabelL .~ "isolated"