termbox 1.1.0 → 1.1.0.1
raw patch · 3 files changed
+7/−12 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- src/Termbox/Internal/Cell.hs +2/−11
- termbox.cabal +1/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+## [1.1.0.1] - 2022-12-01++- Make `char` applied to a wide character result in a space instead of nothing+ ## [1.1.0] - 2022-11-03 - Split off Elm Architecture wrapper into `termbox-tea` package, and expose `run`/`initialize`/`finalize` instead.
src/Termbox/Internal/Cell.hs view
@@ -27,8 +27,7 @@ -- * Set a cell's color with 'fg', 'bg'. -- * Style a cell with 'bold', 'underline', 'blink'. data Cell- = CellEmpty- | CellFg+ = CellFg {-# UNPACK #-} !Char -- invariant: char is width 1 {-# UNPACK #-} !Termbox.Bindings.Hs.Tb_color -- fg | CellFgBlink@@ -45,7 +44,6 @@ drawCell :: Termbox.Bindings.Hs.Tb_color -> Int -> Int -> Cell -> IO () drawCell bg0 col row = \case- CellEmpty -> pure () CellFg ch fg_ -> Termbox.Bindings.Hs.tb_change_cell col row ch fg_ bg0 CellFgBlink ch fg_ -> Termbox.Bindings.Hs.tb_change_cell col row ch fg_ (makeBold bg0) -- bold background = blink CellFgBg ch fg_ bg_ -> Termbox.Bindings.Hs.tb_change_cell col row ch fg_ bg_@@ -55,14 +53,11 @@ -- If the character is not 1 character wide, it will not be displayed. char :: Char -> Cell char ch =- case wcwidth (charToCWchar ch) of- 1 -> CellFg ch Termbox.Bindings.Hs.TB_DEFAULT- _ -> CellEmpty+ CellFg (if wcwidth (charToCWchar ch) == 1 then ch else ' ') Termbox.Bindings.Hs.TB_DEFAULT -- | Set the foreground color of a cell. fg :: Color -> Cell -> Cell fg (Color color) = \case- CellEmpty -> CellEmpty CellFg ch _ -> CellFg ch color CellFgBlink ch _ -> CellFgBlink ch color CellFgBg ch _ bg_ -> CellFgBg ch color bg_@@ -70,7 +65,6 @@ -- | Set the background color of a cell. bg :: Color -> Cell -> Cell bg (Color color) = \case- CellEmpty -> CellEmpty CellFg ch fg_ -> CellFgBg ch fg_ color CellFgBlink ch fg_ -> CellFgBg ch fg_ (makeBold color) -- bold background = blink CellFgBg ch fg_ _ -> CellFgBg ch fg_ color@@ -78,7 +72,6 @@ -- | Make a cell bold. bold :: Cell -> Cell bold = \case- CellEmpty -> CellEmpty CellFg ch fg_ -> CellFg ch (makeBold fg_) CellFgBlink ch fg_ -> CellFgBlink ch (makeBold fg_) CellFgBg ch fg_ bg_ -> CellFgBg ch (makeBold fg_) bg_@@ -86,7 +79,6 @@ -- | Make a cell underlined. underline :: Cell -> Cell underline = \case- CellEmpty -> CellEmpty CellFg ch fg_ -> CellFg ch (makeUnderline fg_) CellFgBlink ch fg_ -> CellFgBlink ch (makeUnderline fg_) CellFgBg ch fg_ bg_ -> CellFgBg ch (makeUnderline fg_) bg_@@ -94,7 +86,6 @@ -- | Make a cell blink. blink :: Cell -> Cell blink = \case- CellEmpty -> CellEmpty CellFg ch fg_ -> CellFgBlink ch fg_ CellFgBlink ch fg_ -> CellFgBlink ch fg_ CellFgBg ch fg_ bg_ -> CellFgBg ch fg_ (makeBold bg_) -- bold background = blink
termbox.cabal view
@@ -22,7 +22,7 @@ name: termbox synopsis: termbox tested-with: GHC == 9.0.2, GHC == 9.2.4, GHC == 9.4.2-version: 1.1.0+version: 1.1.0.1 extra-source-files: CHANGELOG.md