@@ -17,6 +17,7 @@ import qualified Text.Parser.Char as Chr
1717import qualified Text.Parser.Token.Highlight as Hi
1818
1919import Text.PrettyPrint.ANSI.Leijen (Doc, plain)
20+import qualified Text.PrettyPrint.ANSI.Leijen as ANSI
2021
2122import Idris.AbsSyntax hiding (namespace, params)
2223import Idris.DSL
@@ -1120,6 +1121,11 @@ findFC x = let s = show (plain x) in
11201121 (col, ':':msg) -> let pos = (read line, read col) in
11211122 (FC failname pos pos, msg)
11221123
1124+-- | Check if the coloring matches the options and corrects if necessary
1125+fixColour :: Bool -> ANSI.Doc -> ANSI.Doc
1126+fixColour False doc = ANSI.plain doc
1127+fixColour True doc = doc
1128+
11231129-- | A program is a list of declarations, possibly with associated
11241130-- documentation strings.
11251131parseProg :: SyntaxInfo -> FilePath -> String -> Maybe Delta ->
@@ -1132,7 +1138,7 @@ parseProg syn fname input mrk
11321138 let (fc, msg) = findFC doc
11331139 i <- getIState
11341140 case idris_outputmode i of
1135− RawOutput -> ihputStrLn (idris_outh i) (show doc)
1141+ RawOutput -> ihputStrLn (idris_outh i) (show $ fixColour (idris_colourRepl i) doc)
11361142 IdeSlave n -> ihWarn (idris_outh i) fc (P.text msg)
11371143 putIState (i { errSpan = Just fc })
11381144 return []