mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 16:54:42 +03:00
latter entries in the table have precedence. the mock input tests was not reflecting this.
This commit is contained in:
parent
aa67f22b38
commit
7d434d3104
@ -7,8 +7,6 @@ module Main where
|
||||
|
||||
import Verify.Graphics.Vty.Output
|
||||
|
||||
import Data.List (intersperse)
|
||||
|
||||
import Graphics.Vty hiding (resize)
|
||||
import Graphics.Vty.Input.Events
|
||||
import Graphics.Vty.Input.Loop
|
||||
@ -22,6 +20,7 @@ import Control.Monad
|
||||
|
||||
import Data.Default
|
||||
import Data.IORef
|
||||
import Data.List (intersperse, reverse, nubBy)
|
||||
|
||||
import System.Console.Terminfo
|
||||
import System.Posix.IO
|
||||
@ -140,7 +139,9 @@ instance Show (InputBlocksUsingTable event) where
|
||||
instance Monad m => Serial m (InputBlocksUsingTable event) where
|
||||
series = do
|
||||
n :: Int <- localDepth (const maxTableSize) series
|
||||
return $ InputBlocksUsingTable $ \table -> concat (take n (selections table))
|
||||
return $ InputBlocksUsingTable $ \raw_table ->
|
||||
let table = reverse $ nubBy (\(s0,_) (s1,_) -> s0 == s1) $ reverse raw_table
|
||||
in concat (take n (selections table))
|
||||
where
|
||||
selections [] = []
|
||||
selections (x:xs) = let z = selections xs in [x] : (z ++ map ((:) x) z)
|
||||
|
Loading…
Reference in New Issue
Block a user