Wrap around module selections

This commit is contained in:
CrystalSplitter 2023-12-30 21:23:14 -08:00 committed by Jordan R AW
parent 34e494df37
commit 3661ebbbc7

View File

@ -222,7 +222,10 @@ changeReplWidgetSize amnt s =
changeSelectedModuleInInfoPanel :: Int -> AppState n -> AppState n
changeSelectedModuleInInfoPanel amnt s =
s{_infoPanelSelectedModule = _infoPanelSelectedModule s + amnt}
s{_infoPanelSelectedModule = newSelection }
where
newSelection = (_infoPanelSelectedModule s + amnt) `mod` numModules
numModules = length (Loc.moduleFileMapAssocs (Daemon.moduleFileMap (interpState s)))
getSelectedModuleInInfoPanel :: AppState n -> Int
getSelectedModuleInInfoPanel = _infoPanelSelectedModule