on master help sign in
Fix display of :missing on non-ANSI terminals

Before, it was dumping ANSI codes. Now it uses the standard pretty-printing facilities.

commit00d011cccf62954bffc04923303c0dd10b8520d4 authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateFri 2 Oct 2015, 16:19 (11 years ago) parent9f9be2e
1 file changed+9−5
src/Idris/REPL.hs+9−5
src/Idris/REPL.hs+9−5
@@ -1225,12 +1225,16 @@ process fn (Pattelab t)
12251225
12261226process fn (Missing n)
12271227 = do i <- getIState
1228− let i' = i { idris_options = (idris_options i) { opt_showimp = True } }
1228+ ppOpts <- fmap ppOptionIst getIState
12291229 case lookupCtxt n (idris_patdefs i) of
1230− [] -> iPrintError $ "Unknown operator " ++ show n
1231− [(_, tms)] ->
1232− iPrintResult (showSep "\n" (map (showTm i') tms))
1233− _ -> iPrintError $ "Ambiguous name"
1230+ [] -> iPrintError $ "Unknown operator " ++ show n
1231+ [(_, tms)] ->
1232+ iRenderResult (vsep (map (pprintPTerm ppOpts {ppopt_impl = True}
1233+ []
1234+ []
1235+ (idris_infixes i))
1236+ tms))
1237+ _ -> iPrintError $ "Ambiguous name"
12341238process fn (DynamicLink l)
12351239 = do i <- getIState
12361240 let importdirs = opt_importdirs (idris_options i)