From e2273389d579da1666e08f30ef40883a4165bb44 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 28 Jun 2020 20:00:07 -0400 Subject: [PATCH] feat(xan): Any user input cancels autocommands This is quite straightforward - any time the user presses a key that resolves to a command, cancel any active autocommands. Change-Id: Ibb48b0281b0dc6536d75c8957f8c8e5533ff6630 Reviewed-on: https://cl.tvl.fyi/c/depot/+/731 Reviewed-by: glittershark --- users/glittershark/xanthous/src/Xanthous/App.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/users/glittershark/xanthous/src/Xanthous/App.hs b/users/glittershark/xanthous/src/Xanthous/App.hs index e20c5d97b..b43711925 100644 --- a/users/glittershark/xanthous/src/Xanthous/App.hs +++ b/users/glittershark/xanthous/src/Xanthous/App.hs @@ -112,6 +112,7 @@ handleNoPromptEvent :: BrickEvent ResourceName AppEvent -> AppM (Next GameState) handleNoPromptEvent (VtyEvent (EvKey k mods)) | Just command <- commandFromKey k mods = do messageHistory %= nextTurn + cancelAutocommand handleCommand command handleNoPromptEvent (AppEvent AutoContinue) = do preuse (autocommand . _ActiveAutocommand . _1) >>= traverse_ autoStep