@@ -327,8 +327,9 @@ runIdeSlaveCommand id orig fn mods (IdeSlave.Metavariables cols) =
327327 -> ([(String, String, SpanList OutputAnnotation)],
328328 (String, SpanList OutputAnnotation))
329329 sexpGoal ist cols imp ns ([], concl) =
330− let concl' = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
331− pprintPTerm imp (zip ns (repeat False)) [] concl
330+ let infixes = idris_infixes ist
331+ concl' = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
332+ pprintPTerm imp (zip ns (repeat False)) [] infixes concl
332333 in ([], concl')
333334 sexpGoal ist cols imp ns ((n, t):ps, concl) =
334335 let n' = case n of
@@ -337,7 +338,7 @@ runIdeSlaveCommand id orig fn mods (IdeSlave.Metavariables cols) =
337338 | otherwise -> str nm
338339 _ -> "_"
339340 (t', spans) = displaySpans . renderPretty 0.9 cols . fmap (fancifyAnnots ist) $
340− pprintPTerm imp (zip ns (repeat False)) [] t
341+ pprintPTerm imp (zip ns (repeat False)) [] (idris_infixes ist) t
341342 rest = sexpGoal ist cols imp (n:ns) (ps, concl)
342343 in ((n', t', spans) : fst rest, snd rest)
343344runIdeSlaveCommand id orig fn mods (IdeSlave.WhoCalls n) =
@@ -562,21 +563,19 @@ process h fn (Eval t)
562563 ist <- getIState
563564 logLvl 3 $ "Raw: " ++ show (tm', ty')
564565 logLvl 10 $ "Debug: " ++ showEnvDbg [] tm'
565− let imp = opt_showimp (idris_options ist)
566− tmDoc = prettyImp imp (delab ist tm')
567− tyDoc = prettyImp imp (delab ist ty')
566+ let tmDoc = prettyIst ist (delab ist tm')
567+ tyDoc = prettyIst ist (delab ist ty')
568568 ihPrintTermWithType h tmDoc tyDoc
569569
570570process h fn (ExecVal t)
571571 = do ctxt <- getContext
572572 ist <- getIState
573− let imp = opt_showimp (idris_options ist)
574573 (tm, ty) <- elabVal toplevel False t
575574-- let tm' = normaliseAll ctxt [] tm
576575 let ty' = normaliseAll ctxt [] ty
577576 res <- execute tm
578− let (resOut, tyOut) = (prettyImp imp (delab ist res),
579− prettyImp imp (delab ist ty'))
577+ let (resOut, tyOut) = (prettyIst ist (delab ist res),
578+ prettyIst ist (delab ist ty'))
580579 ihPrintTermWithType h resOut tyOut
581580
582581process h fn (Check (PRef _ n))
@@ -611,7 +610,7 @@ process h fn (Check (PRef _ n))
611610 annotate (AnnName n Nothing Nothing Nothing) (text $ show n) <+> colon <+>
612611 align (tPretty bnd ist g)
613612
614− tPretty bnd ist t = pprintPTerm (opt_showimp (idris_options ist)) bnd [] t
613+ tPretty bnd ist t = pprintPTerm (opt_showimp (idris_options ist)) bnd [] (idris_infixes ist) t
615614
616615
617616process h fn (Check t)
@@ -622,19 +621,18 @@ process h fn (Check t)
622621 ty' = normaliseC ctxt [] ty
623622 case tm of
624623 TType _ ->
625− ihPrintTermWithType h (prettyImp imp PType) type1Doc
626− _ -> ihPrintTermWithType h (prettyImp imp (delab ist tm))
627− (prettyImp imp (delab ist ty))
624+ ihPrintTermWithType h (prettyIst ist PType) type1Doc
625+ _ -> ihPrintTermWithType h (prettyIst ist (delab ist tm))
626+ (prettyIst ist (delab ist ty))
628627
629628process h fn (DocStr n)
630− = do i <- getIState
631− let imp = opt_showimp (idris_options i)
632− case lookupCtxtName n (idris_docstrings i) of
629+ = do ist <- getIState
630+ case lookupCtxtName n (idris_docstrings ist) of
633631 [] -> iPrintError $ "No documentation for " ++ show n
634− ns -> do toShow <- mapM (showDoc imp) ns
632+ ns -> do toShow <- mapM (showDoc ist) ns
635633 ihRenderResult h (vsep toShow)
636− where showDoc imp (n, d) = do doc <- getDocs n
637− return $ pprintDocs imp doc
634+ where showDoc ist (n, d) = do doc <- getDocs n
635+ return $ pprintDocs ist doc
638636process h fn Universes
639637 = do i <- getIState
640638 let cs = idris_constraints i
@@ -826,9 +824,11 @@ process h fn (DoProofSearch updatefile rec l n hints)
826824 (tm, ty) <- elabVal toplevel False (PRef fc mn)
827825 ctxt <- getContext
828826 i <- getIState
829− return $ show (stripNS
830− (dropCtxt envlen
831− (delab i (specialise ctxt [] [(mn, 1)] tm)))))
827+ return . flip displayS "" . renderPretty 1.0 80 $
828+ pprintPTerm False [] [] (idris_infixes i)
829+ (stripNS
830+ (dropCtxt envlen
831+ (delab i (specialise ctxt [] [(mn, 1)] tm)))))
832832 (\e -> return ("?" ++ show n))
833833 if updatefile then
834834 do let fb = fn ++ "~"
@@ -1031,6 +1031,8 @@ process h fn (SetOpt ShowOrigErr) = setShowOrigErr True
10311031process h fn (UnsetOpt ShowOrigErr) = setShowOrigErr False
10321032process h fn (SetOpt AutoSolve) = setAutoSolve True
10331033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
1034+process h fn (SetOpt NoBanner) = setNoBanner True
1035+process h fn (UnsetOpt NoBanner) = setNoBanner False
10341036
10351037process h fn (SetOpt _) = iPrintError "Not a valid option"
10361038process h fn (UnsetOpt _) = iPrintError "Not a valid option"
@@ -1051,15 +1053,14 @@ process h fn (SetConsoleWidth w) = setWidth w
10511053
10521054process h fn (Apropos a) =
10531055 do ist <- getIState
1054− let impl = opt_showimp (idris_options ist)
10551056 let names = apropos ist (T.pack a)
10561057 let aproposInfo = [ (n,
10571058 delabTy ist n,
10581059 fmap (overview . fst) (lookupCtxtExact n (idris_docstrings ist)))
10591060 | n <- sort names, isUN n ]
1060− ihRenderResult h $ vsep (map (renderApropos impl) aproposInfo)
1061− where renderApropos impl (name, ty, docs) =
1062− prettyName True [] name <+> colon <+> align (prettyImp impl ty) <$>
1061+ ihRenderResult h $ vsep (map (renderApropos ist) aproposInfo)
1062+ where renderApropos ist (name, ty, docs) =
1063+ prettyName True [] name <+> colon <+> align (prettyIst ist ty) <$>
10631064 fromMaybe empty (fmap (\d -> renderDocstring d <> line) docs)
10641065 isUN (UN _) = True
10651066 isUN (NS n _) = isUN n
@@ -1258,11 +1259,11 @@ loadInputs h inputs
12581259 idris_patdefs = patdefs }))
12591260 (\e -> do i <- getIState
12601261 case e of
1261− At f _ -> do setErrSpan f
1262− ihRenderError stdout $ pprintErr i e
1262+ At f e' -> do setErrSpan f
1263+ ihWarn stdout f $ pprintErr i e'
12631264 ProgramLineComment -> return () -- fail elsewhere
12641265 _ -> do setErrSpan emptyFC -- FIXME! Propagate it
1265− iputStrLn (pshow i e))
1266+ ihWarn stdout emptyFC $ pprintErr i e)
12661267 where -- load all files, stop if any fail
12671268 tryLoad :: Bool -> [IFileType] -> Idris ()
12681269 tryLoad keepstate [] = return ()
@@ -1353,6 +1354,7 @@ idrisMain opts =
13531354 setVerbose verbose
13541355 setCmdLine opts
13551356 setOutputTy outty
1357+ setNoBanner nobanner
13561358 setCodegen cgn
13571359 setTargetTriple trpl
13581360 setTargetCPU tcpu
@@ -1367,6 +1369,8 @@ idrisMain opts =
13671369 (d:_) -> setIBCSubDir d
13681370 setImportDirs importdirs
13691371
1372+ setNoBanner nobanner
1373+
13701374 when (not (NoBasePkgs `elem` opts)) $ do
13711375 addPkgDir "prelude"
13721376 addPkgDir "base"
@@ -1376,6 +1380,11 @@ idrisMain opts =
13761380 return ()
13771381 when (not (NoPrelude `elem` opts)) $ do x <- loadModule stdout "Prelude"
13781382 return ()
1383+
1384+ when (runrepl && not idesl) initScript
1385+
1386+ nobanner <- getNoBanner
1387+
13791388 when (runrepl &&
13801389 not quiet &&
13811390 not idesl &&
@@ -1426,7 +1435,6 @@ idrisMain opts =
14261435
14271436 when (runrepl && not idesl) $ do
14281437-- clearOrigPats
1429− initScript
14301438 startServer orig inputs
14311439 runInputT (replSettings (Just historyFile)) $ repl orig inputs
14321440 when (idesl) $ ideslaveStart orig inputs