diff --git a/CHANGELOG.md b/CHANGELOG.md index e40d178b..5df12928 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Add Apple Silicon (aarch64-darwin) support (#677) - Upgrade to GHC 9.10 (#677) +- Fix `gen --watch` crashing with "Non-exhaustive patterns" on file save (#679) - Web interface - Introducing *impulse* -- foundation for upcoming advanced search, replacing both z-index and legacy JS search (#108) - Remove autoscroll behaviour (which had questionable value to begin with) diff --git a/neuron.cabal b/neuron.cabal index a799c159..5e7dddcd 100644 --- a/neuron.cabal +++ b/neuron.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: neuron -version: 1.9.37.0 +version: 1.9.38.0 license: AGPL-3.0-only copyright: 2020 Sridhar Ratnakumar maintainer: srid@srid.ca diff --git a/src/Neuron/Reactor.hs b/src/Neuron/Reactor.hs index 03880086..1819db66 100644 --- a/src/Neuron/Reactor.hs +++ b/src/Neuron/Reactor.hs @@ -216,15 +216,10 @@ watchDirWithDebounce ms dirPath' = do nubByKeepLast f = reverse . nubBy f . reverse mkEventPathRelative :: FilePath -> FSN.Event -> Maybe FSN.Event - mkEventPathRelative baseDir = \case - FSN.Added fp t d -> - mkR fp <&> \p -> FSN.Added p t d - FSN.Modified fp t d -> - mkR fp <&> \p -> FSN.Modified p t d - FSN.Removed fp t d -> - mkR fp <&> \p -> FSN.Removed p t d - FSN.Unknown fp t d e -> - mkR fp <&> \p -> FSN.Unknown p t d e + mkEventPathRelative baseDir fse = + -- Use record update (rather than matching on each constructor), so that + -- new constructors in fsnotify (eg: CloseWrite) are handled. See #679. + mkR (FSN.eventPath fse) <&> \p -> fse {FSN.eventPath = p} where mkR fp = do let rel = makeRelative baseDir fp