Fix duplicate messages
authorLuke Lau <luke_lau@icloud.com>
Fri, 29 Jun 2018 01:00:00 +0000 (02:00 +0100)
committerLuke Lau <luke_lau@icloud.com>
Fri, 29 Jun 2018 01:00:00 +0000 (02:00 +0100)
src/Language/Haskell/LSP/Test/Parsing.hs

index db5e4433b582dde899d7b0ae908eb1fa52b4a850..b28047ce0f93ac75fee9f54fad0581ab39d9ebf7 100644 (file)
@@ -29,13 +29,13 @@ satisfy pred = do
   x <- await
   liftIO $ killThread timeoutThread
 
+  if pred x
+    then do
       liftIO $ do
         setSGR [SetColor Foreground Vivid Magenta]
         putStrLn $ "<-- " ++ B.unpack (encodeMsg x)
         setSGR [Reset]
-
-  if pred x
-    then return x
+      return x
     else empty
 
 -- | Matches if the message is a notification.