From a83c2f69505dfecdee279f8f8e6f3208a677ad80 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 19 Jul 2021 13:18:20 -1000 Subject: [PATCH] ;cln: ui: clarify watch loop --- hledger-ui/Hledger/UI/Main.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hledger-ui/Hledger/UI/Main.hs b/hledger-ui/Hledger/UI/Main.hs index 569644f14ca..aba2eb6fbf6 100644 --- a/hledger-ui/Hledger/UI/Main.hs +++ b/hledger-ui/Hledger/UI/Main.hs @@ -195,10 +195,11 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=_iopts,reportspec_=rsp writeChan eventChan dc watchDate new - withAsync - (getCurrentDay >>= watchDate) - $ \_ -> - + withAsync + -- run this small task asynchronously: + (getCurrentDay >>= watchDate) + -- until this main task terminates: + $ \_async -> -- start one or more background threads reporting changes in the directories of our files -- XXX many quick successive saves causes the problems listed in BUGS -- with Debounce increased to 1s it easily gets stuck on an error or blank screen