mirror of
https://github.com/NorfairKing/feedback.git
synced 2024-11-23 05:23:37 +03:00
Make ormolu happy
This commit is contained in:
parent
8960d8cc02
commit
b70e637ac0
@ -107,11 +107,7 @@ processWorker runSettings eventChan outputChan = do
|
||||
waitForEvent :: Chan FS.Event -> IO RestartEvent
|
||||
waitForEvent eventChan = do
|
||||
isTerminal <- hIsTerminalDevice stdin
|
||||
#ifdef MIN_VERSION_Win32
|
||||
isMinTTY <- withHandleToHANDLE stdin isMinTTYHandle
|
||||
#else
|
||||
let isMinTTY = False
|
||||
#endif
|
||||
isMinTTY <- getMinTTY
|
||||
if isTerminal || isMinTTY
|
||||
then do
|
||||
hSetBuffering stdin NoBuffering
|
||||
@ -120,6 +116,12 @@ waitForEvent eventChan = do
|
||||
(StdinEvent <$> hGetChar stdin)
|
||||
(FSEvent <$> readChan eventChan)
|
||||
else FSEvent <$> readChan eventChan
|
||||
where
|
||||
#ifdef MIN_VERSION_Win32
|
||||
getMinTTY = withHandleToHANDLE stdin isMinTTYHandle
|
||||
#else
|
||||
getMinTTY = pure False
|
||||
#endif
|
||||
|
||||
data Output
|
||||
= OutputEvent !RestartEvent
|
||||
|
@ -29,16 +29,18 @@ import UnliftIO
|
||||
getStdinFiles :: Path Abs Dir -> IO (Maybe (Set FilePath))
|
||||
getStdinFiles here = do
|
||||
isTerminal <- hIsTerminalDevice stdin
|
||||
#ifdef MIN_VERSION_Win32
|
||||
isMinTTY <- withHandleToHANDLE stdin isMinTTYHandle
|
||||
#else
|
||||
let isMinTTY = False
|
||||
#endif
|
||||
isMinTTY <- getMinTTY
|
||||
if isTerminal || isMinTTY
|
||||
then pure Nothing
|
||||
else
|
||||
(Just <$> handleFileSet here stdin)
|
||||
`catch` (\(_ :: IOException) -> pure Nothing)
|
||||
where
|
||||
#ifdef MIN_VERSION_Win32
|
||||
getMinTTY = withHandleToHANDLE stdin isMinTTYHandle
|
||||
#else
|
||||
getMinTTY = pure False
|
||||
#endif
|
||||
|
||||
mkEventFilter :: Path Abs Dir -> Maybe (Set FilePath) -> FilterSettings -> IO (FS.Event -> Bool)
|
||||
mkEventFilter here mStdinFiles FilterSettings {..} = do
|
||||
|
Loading…
Reference in New Issue
Block a user