imp: ui: support/require fsnotify 0.4.x

This commit is contained in:
Simon Michael 2022-09-19 17:56:01 -10:00
parent f0b16f22a2
commit 45ee5d125d
5 changed files with 6 additions and 4 deletions

View File

@ -23,7 +23,7 @@ import Graphics.Vty (mkVty, Mode (Mouse), Vty (outputIface), Output (setMode))
import Lens.Micro ((^.))
import System.Directory (canonicalizePath)
import System.FilePath (takeDirectory)
import System.FSNotify (Event(Modified), isPollingManager, watchDir, withManager)
import System.FSNotify (Event(Modified), watchDir, withManager, EventIsDirectory (IsFile))
import Brick hiding (bsDraw)
import qualified Brick.BChan as BC
@ -201,7 +201,6 @@ runBrickUi uopts0@UIOpts{uoCliOpts=copts@CliOpts{inputopts_=_iopts,reportspec_=r
-- with Debounce at the default 1ms it clears transient errors itself
-- but gets tied up for ages
withManager $ \mgr -> do
dbg1IO "fsnotify using polling ?" $ isPollingManager mgr
files <- mapM (canonicalizePath . fst) $ jfiles j
let directories = nubSort $ map takeDirectory files
dbg1IO "files" files
@ -212,7 +211,7 @@ runBrickUi uopts0@UIOpts{uoCliOpts=copts@CliOpts{inputopts_=_iopts,reportspec_=r
d
-- predicate: ignore changes not involving our files
(\case
Modified f _ False -> f `elem` files
Modified f _ IsFile -> f `elem` files
-- Added f _ -> f `elem` files
-- Removed f _ -> f `elem` files
-- we don't handle adding/removing journal files right now

View File

@ -62,7 +62,7 @@ dependencies:
- doclayout >=0.3 && <0.5
- extra >=1.6.3
- filepath
- fsnotify >=0.2.1.2 && <0.4
- fsnotify >=0.4 && <0.5
- microlens >=0.4
- microlens-platform >=0.2.3.1
- megaparsec >=7.0.0 && <9.3

View File

@ -14,6 +14,7 @@ extra-deps:
# for hledger:
# for hledger-ui:
- brick-1.0
- fsnotify-0.4.0.0
# for hledger-web:
# for Shake.hs:

View File

@ -20,6 +20,7 @@ extra-deps:
# for hledger-ui:
- brick-1.0
- bimap-0.5.0
- fsnotify-0.4.0.0
- text-zipper-0.12
- vty-5.36
# for hledger-web:

View File

@ -23,6 +23,7 @@ extra-deps:
# for hledger-ui:
- brick-1.0
- bimap-0.5.0
- fsnotify-0.4.0.0
- text-zipper-0.12
- vty-5.36
# for hledger-web: