on master help sign in
Don't use Curses to look for console width in IDESlave

Now, setting automatic width in IDESlave mode is equivalent to setting infinite width.

commita83671e7b713a3b0b185234d018f14ad2b7f9758 authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateTue 4 Feb 2014, 22:46 (13 years ago) parentc15b21b
1 file changed+7−2
src/Idris/AbsSyntax.hs+7−2
src/Idris/AbsSyntax.hs+7−2
@@ -425,14 +425,19 @@ renderWidth = do iw <- getWidth
425425
426426iRender :: Doc a -> Idris (SimpleDoc a)
427427iRender d = do w <- getWidth
428+ ist <- getIState
429+ let ideSlave = case idris_outputmode ist of
430+ IdeSlave _ -> True
431+ _ -> False
428432 case w of
429433 InfinitelyWide -> return $ renderPretty 1.0 1000000000 d
430434 ColsWide n -> return $
431435 if n < 1
432436 then renderPretty 1.0 1000000000 d
433437 else renderPretty 0.8 n d
434− AutomaticWidth -> do width <- runIO getScreenWidth
435− return $ renderPretty 0.8 width d
438+ AutomaticWidth | ideSlave -> return $ renderPretty 1.0 1000000000 d
439+ | otherwise -> do width <- runIO getScreenWidth
440+ return $ renderPretty 0.8 width d
436441
437442ihPrintResult :: Handle -> String -> Idris ()
438443ihPrintResult h s = do i <- getIState