on master help sign in
Output: whitespace cleanup
31dc43fJonathan Daugherty
src/Graphics/Vty/Output.hs+5−8
@@ -1,6 +1,5 @@
1{-# LANGUAGE RecordWildCards #-}
1{-# LANGUAGE RecordWildCards #-}
2{-# LANGUAGE NamedFieldPuns #-}
2{-# LANGUAGE NamedFieldPuns #-}
3−
4-- | Output interface.
3-- | Output interface.
5--
4--
6-- Access to the current terminal or a specific terminal device.
5-- Access to the current terminal or a specific terminal device.
@@ -8,8 +7,8 @@
8-- See also:
7-- See also:
9--
8--
10-- 1. "Graphics.Vty.Output": This instantiates an abtract interface to the terminal interface based
9-- 1. "Graphics.Vty.Output": This instantiates an abtract interface to the terminal interface based
11−-- on the TERM and COLORTERM environment variables.
10+-- on the TERM and COLORTERM environment variables.
12−--
11+--
13-- 2. "Graphics.Vty.Output.Interface": Defines the generic interface all terminals need to implement.
12-- 2. "Graphics.Vty.Output.Interface": Defines the generic interface all terminals need to implement.
14--
13--
15-- 3. "Graphics.Vty.Output.TerminfoBased": Defines a terminal instance that uses terminfo for all
14-- 3. "Graphics.Vty.Output.TerminfoBased": Defines a terminal instance that uses terminfo for all
@@ -18,7 +17,7 @@
18--
17--
19-- 4. "Graphics.Vty.Output.XTermColor": This module contains an interface suitable for xterm-like
18-- 4. "Graphics.Vty.Output.XTermColor": This module contains an interface suitable for xterm-like
20-- terminals. These are the terminals where TERM == xterm. This does use terminfo for as many
19-- terminals. These are the terminals where TERM == xterm. This does use terminfo for as many
21−-- control codes as possible.
20+-- control codes as possible.
22module Graphics.Vty.Output ( module Graphics.Vty.Output
21module Graphics.Vty.Output ( module Graphics.Vty.Output
23 , Output(..) -- \todo hide constructors
22 , Output(..) -- \todo hide constructors
24 , AssumedState(..)
23 , AssumedState(..)
@@ -28,7 +27,6 @@ module Graphics.Vty.Output ( module Graphics.Vty.Output
28 )
27 )
29 where
28 where
30
29
31−
32import Graphics.Vty.Prelude
30import Graphics.Vty.Prelude
33
31
34import Graphics.Vty.Config
32import Graphics.Vty.Config
@@ -70,7 +68,7 @@ outputForConfig Config{ outputFd = Just fd, termName = Just termName, .. } = do
70 return t
68 return t
71outputForConfig config = (<> config) <$> standardIOConfig >>= outputForConfig
69outputForConfig config = (<> config) <$> standardIOConfig >>= outputForConfig
72
70
73−-- | Sets the cursor position to the given output column and row.
71+-- | Sets the cursor position to the given output column and row.
74--
72--
75-- This is not necessarially the same as the character position with the same coordinates.
73-- This is not necessarially the same as the character position with the same coordinates.
76-- Characters can be a variable number of columns in width.
74-- Characters can be a variable number of columns in width.
@@ -90,11 +88,10 @@ hideCursor t = do
90 bounds <- displayBounds t
88 bounds <- displayBounds t
91 dc <- displayContext t bounds
89 dc <- displayContext t bounds
92 liftIO $ outputByteBuffer t $ writeToByteString $ writeHideCursor dc
90 liftIO $ outputByteBuffer t $ writeToByteString $ writeHideCursor dc
93−
91+
94-- | Shows the cursor
92-- | Shows the cursor
95showCursor :: MonadIO m => Output -> m ()
93showCursor :: MonadIO m => Output -> m ()
96showCursor t = do
94showCursor t = do
97 bounds <- displayBounds t
95 bounds <- displayBounds t
98 dc <- displayContext t bounds
96 dc <- displayContext t bounds
99 liftIO $ outputByteBuffer t $ writeToByteString $ writeShowCursor dc
97 liftIO $ outputByteBuffer t $ writeToByteString $ writeShowCursor dc
100−