on master help sign in
cleanup
eb15f26Corey O'Connor
src/Graphics/Vty/Input.hs+1−1
@@ -72,7 +72,7 @@ input_for_current_terminal config = do
72-- - disables software flow control on outgoing data. This stops the process from being
72-- - disables software flow control on outgoing data. This stops the process from being
73-- suspended if the output terminal cannot keep up. I presume this has little effect these
73-- suspended if the output terminal cannot keep up. I presume this has little effect these
74-- days. I hope this means that output will be buffered if the terminal cannot keep up. In the
74-- days. I hope this means that output will be buffered if the terminal cannot keep up. In the
75−-- old days the output might of been dropped.
75+-- old days the output might of been dropped?
76--
76--
77-- "raw" mode is used for input.
77-- "raw" mode is used for input.
78--
78--
src/Graphics/Vty/Input/Internal.hs+4−3
@@ -14,7 +14,7 @@ import Control.Applicative
14import Control.Concurrent
14import Control.Concurrent
15import Control.Lens
15import Control.Lens
16import Control.Exception (try, IOException)
16import Control.Exception (try, IOException)
17−import Control.Monad (when, void, mzero)
17+import Control.Monad (when, void, mzero, forM_)
18import Control.Monad.IO.Class (liftIO)
18import Control.Monad.IO.Class (liftIO)
19import Control.Monad.Trans.State (StateT(..), evalStateT)
19import Control.Monad.Trans.State (StateT(..), evalStateT)
20import Control.Monad.Trans.Reader (ReaderT(..))
20import Control.Monad.Trans.Reader (ReaderT(..))
@@ -89,7 +89,8 @@ type InputM a = StateT InputState (ReaderT Input IO) a
89loop_input_processor :: InputM ()
89loop_input_processor :: InputM ()
90loop_input_processor = do
90loop_input_processor = do
91 read_from_device >>= add_bytes_to_process
91 read_from_device >>= add_bytes_to_process
92− _ <- many $ parse_event >>= emit
92+ valid_events <- many parse_event
93+ forM_ valid_events emit
93 drop_invalid
94 drop_invalid
94 stop_if_requested <|> loop_input_processor
95 stop_if_requested <|> loop_input_processor
95
96
@@ -116,7 +117,7 @@ read_from_device = do
116apply_timing_config :: Fd -> Config -> IO ()
117apply_timing_config :: Fd -> Config -> IO ()
117apply_timing_config fd config =
118apply_timing_config fd config =
118 let vtime = min 255 $ singleEscPeriod config `div` 100000
119 let vtime = min 255 $ singleEscPeriod config `div` 100000
119− in set_term_timing fd 1 vtime
120+ in set_term_timing fd 0 vtime
120
121
121parse_event :: InputM Event
122parse_event :: InputM Event
122parse_event = do
123parse_event = do