on master help sign in
Merge pull request #842 from Melvar/ideslave-consolewidth

Make IdeSlave mode follow :consolewidth commands

commit6a77afae50a933077e0887c98664d75f5b2ef5f2 authorEdwin Brady <edwin.brady@gmail.com> dateTue 4 Feb 2014, 00:18 (13 years ago) parentb7d6d4149df329
2 files changed+7−5
src/Idris/AbsSyntax.hs+5−5 src/Idris/REPL.hs+2
src/Idris/AbsSyntax.hs+5−5
@@ -456,11 +456,11 @@ consoleDisplayAnnotated h output = do ist <- getIState
456456-- | Write pretty-printed output to IDESlave with semantic annotations
457457ideSlaveReturnAnnotated :: Integer -> Handle -> Doc OutputAnnotation -> Idris ()
458458ideSlaveReturnAnnotated n h out = do ist <- getIState
459− let (str, spans) = displaySpans .
460− renderPretty 0.8 80 .
461− fmap (fancifyAnnots ist) $
462− out
463− good = [SymbolAtom "ok", toSExp str, toSExp spans]
459+ (str, spans) <- fmap displaySpans .
460+ iRender .
461+ fmap (fancifyAnnots ist) $
462+ out
463+ let good = [SymbolAtom "ok", toSExp str, toSExp spans]
464464 runIO . hPutStrLn h $ convSExp "return" good n
465465
466466ihPrintTermWithType :: Handle -> Doc OutputAnnotation -> Doc OutputAnnotation -> Idris ()
src/Idris/REPL.hs+2
@@ -325,6 +325,8 @@ ideslaveProcess fn (AddClauseFrom False pos str) = process stdout fn (AddClauseF
325325ideslaveProcess fn (AddMissing False pos str) = process stdout fn (AddMissing False pos str)
326326ideslaveProcess fn (MakeWith False pos str) = process stdout fn (MakeWith False pos str)
327327ideslaveProcess fn (DoProofSearch False pos str xs) = process stdout fn (DoProofSearch False pos str xs)
328+ideslaveProcess fn (SetConsoleWidth w) = do process stdout fn (SetConsoleWidth w)
329+ iPrintResult ""
328330ideslaveProcess fn _ = iPrintError "command not recognized or not supported"
329331
330332