@@ -12,6 +12,7 @@ import Data.Terminfo.Parse
12import Data.Terminfo.Eval
12import Data.Terminfo.Eval
14import Graphics.Vty.Attributes
14import Graphics.Vty.Attributes
15+import Graphics.Vty.DisplayAttributes
15import Graphics.Vty.Terminal.Generic
16import Graphics.Vty.Terminal.Generic
16import Graphics.Vty.DisplayRegion
17import Graphics.Vty.DisplayRegion
@@ -19,9 +20,8 @@ import Control.Applicative
19import Control.Monad ( foldM )
20import Control.Monad ( foldM )
21import Data.Bits ( (.&.) )
22import Data.Bits ( (.&.) )
22−import Data.List ( foldl' )
23import Data.Maybe ( fromJust )
23import Data.Maybe ( fromJust )
24−import Data.Monoid
24+import Data.Monoid
25import Data.Word
25import Data.Word
27import Foreign.C.Types ( CLong )
27import Foreign.C.Types ( CLong )
@@ -197,7 +197,7 @@ instance DisplayTerminal DisplayContext where
197 -- Which is assumed to the be less than 512 for now.
197 -- Which is assumed to the be less than 512 for now.
199 -- \todo Not verified as safe and wastes memory.
199 -- \todo Not verified as safe and wastes memory.
200− attr_required_bytes d _prev_attr _req_attr _diffs = 512
200+ attr_required_bytes _d _prev_attr _req_attr _diffs = 512
202 -- Portably setting the display attributes is a giant pain in the ass.
202 -- Portably setting the display attributes is a giant pain in the ass.
203 -- If the terminal supports the sgr capability (which sets the on/off state of each style
203 -- If the terminal supports the sgr capability (which sets the on/off state of each style
@@ -230,7 +230,7 @@ instance DisplayTerminal DisplayContext where
230 EnterExitSeq caps
230 EnterExitSeq caps
231 -- only way to reset a color to the defaults
231 -- only way to reset a color to the defaults
232 -> serialize_default_attr d out_ptr
232 -> serialize_default_attr d out_ptr
233− >>= (\ptr -> foldM (\ptr cap -> serialize_cap_expression cap [] ptr) ptr caps)
233+ >>= (\out_ptr' -> foldM (\ptr cap -> serialize_cap_expression cap [] ptr) out_ptr' caps)
234 >>= set_colors
234 >>= set_colors
235 SetState state
235 SetState state
236 -- implicitly resets the colors to the defaults
236 -- implicitly resets the colors to the defaults
@@ -284,7 +284,7 @@ instance DisplayTerminal DisplayContext where
284 return ptr''
284 return ptr''
285 apply_color_diff _f NoColorChange ptr
285 apply_color_diff _f NoColorChange ptr
286 = return ptr
286 = return ptr
287− apply_color_diff _f ColorToDefault ptr
287+ apply_color_diff _f ColorToDefault _ptr
288 = fail "ColorToDefault is not a possible case for apply_color_diffs"
288 = fail "ColorToDefault is not a possible case for apply_color_diffs"
289 apply_color_diff f ( SetColor c ) ptr
289 apply_color_diff f ( SetColor c ) ptr
290 = serialize_cap_expression ( f $ term d )
290 = serialize_cap_expression ( f $ term d )
@@ -362,13 +362,13 @@ sgr_args_for_state attr_state = map (\b -> if b then 1 else 0)
364req_display_cap_seq_for :: DisplayAttrCaps -> Style -> [StyleStateChange] -> DisplayAttrSeq CapExpression
364req_display_cap_seq_for :: DisplayAttrCaps -> Style -> [StyleStateChange] -> DisplayAttrSeq CapExpression
365−req_display_cap_seq_for caps style diffs =
365+req_display_cap_seq_for caps s diffs =
366 -- First pass: concat the monoid points that are implied by the diffs
366 -- First pass: concat the monoid points that are implied by the diffs
367 let base = mconcat $ map diff_point diffs
367 let base = mconcat $ map diff_point diffs
368 -- Second pass: Apply the capability restrictions.
368 -- Second pass: Apply the capability restrictions.
369 in apply_caps base
369 in apply_caps base
371− set_state = SetState $ state_for_style style
371+ set_state = SetState $ state_for_style s
372 diff_point ApplyStandout = EnterExitSeq [ApplyStandout]
372 diff_point ApplyStandout = EnterExitSeq [ApplyStandout]
373 diff_point ApplyUnderline = EnterExitSeq [ApplyUnderline]
373 diff_point ApplyUnderline = EnterExitSeq [ApplyUnderline]
374 diff_point ApplyReverseVideo = EnterExitSeq [ApplyReverseVideo]
374 diff_point ApplyReverseVideo = EnterExitSeq [ApplyReverseVideo]