@@ -37,6 +37,7 @@ textInput
37 -> VtyWidget t m (Dynamic t Text)
37 -> VtyWidget t m (Dynamic t Text)
38textInput cfg = do
38textInput cfg = do
39 i <- input
39 i <- input
40 rec v <- foldDyn ($) (_textInputConfig_initialValue cfg) $ mergeWith (.)
41 rec v <- foldDyn ($) (_textInputConfig_initialValue cfg) $ mergeWith (.)
41 [ updateTextZipper <$> i
42 [ updateTextZipper <$> i
42 , _textInputConfig_modify cfg
43 , _textInputConfig_modify cfg
@@ -47,7 +48,8 @@ textInput cfg = do
47 dw <- displayWidth
48 dw <- displayWidth
48 dh <- displayHeight
49 dh <- displayHeight
49 click <- mouseDown V.BLeft
50 click <- mouseDown V.BLeft
51+ let cursorAttrs = ffor f $ \x -> if x then cursorAttributes else V.defAttr
50− let rows = (\w s -> displayLines w V.defAttr cursorAttributes s) <$> dw <*> v
52+ let rows = (\w s c -> displayLines w V.defAttr c s) <$> dw <*> v <*> cursorAttrs
51 img = images . _displayLines_spans <$> rows
53 img = images . _displayLines_spans <$> rows
52 y <- holdUniqDyn $ _displayLines_cursorY <$> rows
54 y <- holdUniqDyn $ _displayLines_cursorY <$> rows
53 let newScrollTop :: Int -> (Int, Int) -> Int
55 let newScrollTop :: Int -> (Int, Int) -> Int