@@ -30,13 +30,13 @@ data TextInputConfig t = TextInputConfig
30 { _textInputConfig_initialValue :: TextZipper
30 { _textInputConfig_initialValue :: TextZipper
31 , _textInputConfig_modify :: Event t (TextZipper -> TextZipper)
31 , _textInputConfig_modify :: Event t (TextZipper -> TextZipper)
32 , _textInputConfig_tabWidth :: Int
32 , _textInputConfig_tabWidth :: Int
33− , _textInputConfig_display :: Char -> Char
33+ , _textInputConfig_display :: Dynamic t (Char -> Char)
34 -- ^ Transform the characters in a text input before displaying them. This is useful, e.g., for
34 -- ^ Transform the characters in a text input before displaying them. This is useful, e.g., for
35 -- masking characters when entering passwords.
35 -- masking characters when entering passwords.
38instance Reflex t => Default (TextInputConfig t) where
38instance Reflex t => Default (TextInputConfig t) where
39− def = TextInputConfig empty never 4 id
39+ def = TextInputConfig empty never 4 (pure id)
41-- | The output produced by text input widgets, including the text
41-- | The output produced by text input widgets, including the text
42-- value and the number of display lines (post-wrapping). Note that some
42-- value and the number of display lines (post-wrapping). Note that some
@@ -67,7 +67,7 @@ textInput cfg = do
67 let cursorAttrs = ffor f $ \x -> if x then cursorAttributes else V.defAttr
67 let cursorAttrs = ffor f $ \x -> if x then cursorAttributes else V.defAttr
68 let rows = (\w s c -> displayLines w V.defAttr c s)
68 let rows = (\w s c -> displayLines w V.defAttr c s)
70− <*> (mapZipper (_textInputConfig_display cfg) <$> v)
70+ <*> (mapZipper <$> _textInputConfig_display cfg <*> v)
71 <*> cursorAttrs
71 <*> cursorAttrs
72 img = images . _displayLines_spans <$> rows
72 img = images . _displayLines_spans <$> rows
73 y <- holdUniqDyn $ _displayLines_cursorY <$> rows
73 y <- holdUniqDyn $ _displayLines_cursorY <$> rows