@@ -17,6 +17,7 @@ import qualified Text.Parser.Char as Chr
17import qualified Text.Parser.Token.Highlight as Hi
17import qualified Text.Parser.Token.Highlight as Hi
19import Text.PrettyPrint.ANSI.Leijen (Doc, plain)
19import Text.PrettyPrint.ANSI.Leijen (Doc, plain)
20+import qualified Text.PrettyPrint.ANSI.Leijen as ANSI
21import Idris.AbsSyntax hiding (namespace, params)
22import Idris.AbsSyntax hiding (namespace, params)
22import Idris.DSL
23import Idris.DSL
@@ -1120,6 +1121,11 @@ findFC x = let s = show (plain x) in
1120 (col, ':':msg) -> let pos = (read line, read col) in
1121 (col, ':':msg) -> let pos = (read line, read col) in
1121 (FC failname pos pos, msg)
1122 (FC failname pos pos, msg)
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
1123-- | A program is a list of declarations, possibly with associated
1129-- | A program is a list of declarations, possibly with associated
1124-- documentation strings.
1130-- documentation strings.
1125parseProg :: SyntaxInfo -> FilePath -> String -> Maybe Delta ->
1131parseProg :: SyntaxInfo -> FilePath -> String -> Maybe Delta ->
@@ -1132,7 +1138,7 @@ parseProg syn fname input mrk
1132 let (fc, msg) = findFC doc
1138 let (fc, msg) = findFC doc
1133 i <- getIState
1139 i <- getIState
1134 case idris_outputmode i of
1140 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)
1136 IdeSlave n -> ihWarn (idris_outh i) fc (P.text msg)
1142 IdeSlave n -> ihWarn (idris_outh i) fc (P.text msg)
1137 putIState (i { errSpan = Just fc })
1143 putIState (i { errSpan = Just fc })
1138 return []
1144 return []