Skip to content

Commit

Permalink
Compatibility patch for vty-5.20.
Browse files Browse the repository at this point in the history
  • Loading branch information
SOwOphie committed Feb 20, 2018
1 parent 25c5223 commit 8a62c4f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v1.2.2b

- Small compatibility patch for `vty-5.20`.
- Added `/usr/local/etc/wsedit` to the config search path.

# v1.2.2

## New Features
Expand Down
2 changes: 1 addition & 1 deletion src/WSEdit/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ import qualified WSEdit.Buffer as B

-- | Version number constant.
version :: String
version = "1.2.2.18"
version = "1.2.2.19"

-- | Upstream URL.
upstream :: String
Expand Down
10 changes: 7 additions & 3 deletions src/WSEdit/Help.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import Graphics.Vty
( BLeft
, BMiddle
, BRight
, BScrollUp
, BScrollDown
)
, Event
( EvKey
Expand Down Expand Up @@ -193,9 +195,11 @@ keymapHelp km =
showKey k = drop 1 $ show k

showBtn :: Button -> String
showBtn BLeft = "LMB"
showBtn BMiddle = "MMB"
showBtn BRight = "RMB"
showBtn BLeft = "LMB"
showBtn BMiddle = "MMB"
showBtn BRight = "RMB"
showBtn BScrollUp = "Scroll Up"
showBtn BScrollDown = "Scroll Down"



Expand Down
5 changes: 5 additions & 0 deletions src/WSEdit/Output.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import Graphics.Vty
, attrBackColor
, attrForeColor
, attrStyle
, attrURL
)
, Background
( ClearBackground
Expand Down Expand Up @@ -367,6 +368,10 @@ lineRep lNo off str = do
, attrBackColor = tryPreserve
(attrBackColor $ csNominal cs)
(attrBackColor $ sNominal x )

, attrURL = tryPreserve
(attrURL $ csNominal cs)
(attrURL $ sNominal x )
}
, csStr = sStr x
}
Expand Down
2 changes: 2 additions & 0 deletions src/WSEdit/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ import Graphics.Vty
, attrStyle
, attrForeColor
, attrBackColor
, attrURL
)
, MaybeDefault
( Default
Expand Down Expand Up @@ -623,6 +624,7 @@ combineAttrs a b = Attr
{ attrStyle = combineMayDef (attrStyle a) (attrStyle b)
, attrForeColor = combineMayDef (attrForeColor a) (attrForeColor b)
, attrBackColor = combineMayDef (attrBackColor a) (attrBackColor b)
, attrURL = combineMayDef (attrURL a) (attrURL b)
}
where
combineMayDef :: MaybeDefault a -> MaybeDefault a -> MaybeDefault a
Expand Down
3 changes: 2 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
flags: {}
extra-package-dbs: []
packages:
- '.'
- .
extra-deps:
- vty-5.20
resolver: lts-8.0
4 changes: 2 additions & 2 deletions wsedit.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wsedit
version: 1.2.2.18
version: 1.2.2.19
synopsis: A simple terminal source code editor.
description:
homepage: https://github.com/LadyBoonami/wsedit
Expand Down Expand Up @@ -68,7 +68,7 @@ library
strict >= 0.3.2 && < 1,
transformers >= 0.4.2 && < 1,
unix >= 2.7 && < 3,
vty >= 5.6 && < 6
vty >= 5.20 && < 6

ghc-options:
-Wall
Expand Down

0 comments on commit 8a62c4f

Please sign in to comment.