@@ -1158,8 +1158,7 @@ loadModule outh f
11581158 = idrisCatch (loadModule' outh f)
11591159 (\e -> do setErrSpan (getErrSpan e)
11601160 ist <- getIState
1161− msg <- showErr e
1162− ihputStrLn outh msg
1161+ ihWarn outh (getErrSpan e) $ pprintErr ist e
11631162 return "")
11641163
11651164{- | Load idris module -}
@@ -1169,7 +1168,7 @@ loadModule' outh f
11691168 let file = takeWhile (/= ' ') f
11701169 ibcsd <- valIBCSubDir i
11711170 ids <- allImportDirs
1172− fp <- liftIO $ findImport ids ibcsd file
1171+ fp <- findImport ids ibcsd file
11731172 if file `elem` imported i
11741173 then iLOG $ "Already read " ++ file
11751174 else do putIState (i { imported = file : imported i })
@@ -1206,7 +1205,9 @@ loadSource' h lidr r
12061205 = idrisCatch (loadSource h lidr r)
12071206 (\e -> do setErrSpan (getErrSpan e)
12081207 ist <- getIState
1209− ihRenderError h (pprintErr ist e))
1208+ case e of
1209+ At f e' -> ihWarn h f (pprintErr ist e')
1210+ _ -> ihWarn h (getErrSpan e) (pprintErr ist e))
12101211
12111212{- | Load Idris source code-}
12121213loadSource :: Handle -> Bool -> FilePath -> Idris ()
@@ -1219,7 +1220,7 @@ loadSource h lidr f
12191220 (mname, imports, pos) <- parseImports f file
12201221 ids <- allImportDirs
12211222 ibcsd <- valIBCSubDir i
1222− mapM_ (\f -> do fp <- runIO $ findImport ids ibcsd f
1223+ mapM_ (\f -> do fp <- findImport ids ibcsd f
12231224 case fp of
12241225 LIDR fn -> ifail $ "No ibc for " ++ f
12251226 IDR fn -> ifail $ "No ibc for " ++ f