Skip to content

Commit

Permalink
Merge pull request #79 from minimapletinytools/bumpversion
Browse files Browse the repository at this point in the history
upgrade to vty >=6
  • Loading branch information
ali-abrar authored Jan 25, 2024
2 parents a55b4c2 + 28514b1 commit 8fe89f1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 21 deletions.
5 changes: 2 additions & 3 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Revision history for reflex-vty

## Unreleased 0.5.1.1

## 0.5.2.0
* Update to use latest version of vty (for cross-platform support)
* Fix an issue where the cursor tag is not used for an empty string in `displayLineWithAlignment`

## 0.5.1.0

* Change `inputInFocusedRegion` to filter mouse scroll wheel input based on if the region under than the mouse rather than using mouse drag tracking
* Add MonadCatch, MonadThrow, and MonadMask instances (relies on reflex-0.9.2.0 or greater)

Expand Down
6 changes: 3 additions & 3 deletions dep/reflex-platform/github.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"owner": "reflex-frp",
"repo": "reflex-platform",
"branch": "develop",
"branch": "release/1.2.0.0",
"private": false,
"rev": "6c8830e059a6d2859cb1b65acefed3c2f1d216d3",
"sha256": "06kv45yq8qan0p22wzj5c9mx11ns1wddyqjr1xasjjkf6gaf0080"
"rev": "f231e2425ac92339b8491cdd970930d63d9ad1ad",
"sha256": "0b042x423p04shhidni08f47ydgpfj0rpqhb0m6gj2lg8b3s9l8k"
}
7 changes: 4 additions & 3 deletions reflex-vty.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: reflex-vty
version: 0.5.1.1
version: 0.5.2.0
synopsis: Reflex FRP host and widgets for VTY applications
description:
Build terminal applications using functional reactive programming (FRP) with Reflex FRP (<https://reflex-frp.org>).
Expand Down Expand Up @@ -40,7 +40,7 @@ library
, Reflex.Spider.Orphans
, Control.Monad.NodeId
build-depends:
base >= 4.10.0 && < 4.19,
base >= 4.10.0 && < 4.20,
bimap >= 0.3.3 && < 0.6,
containers >= 0.5.0 && < 0.7,
mtl >= 2.2.2 && < 2.4,
Expand All @@ -58,7 +58,8 @@ library
ref-tf >= 0.4.0 && < 0.6,
reflex >= 0.9.2 && < 1,
time >= 1.8.0 && < 1.13,
vty >= 5.28 && < 5.39
vty >= 6.0 && < 6.2,
vty-crossplatform >= 0.1 && < 0.5
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
Expand Down
24 changes: 14 additions & 10 deletions release.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
{ reflex-platform ? import ./dep/reflex-platform
, supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
}:
let
rp = reflex-platform {};
pkgs = rp.nixpkgs;
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
inherit (pkgs) lib;
haskellLib = pkgs.haskell.lib;
commonOverrides = self: super: {
vty = self.callHackageDirect {
pkg = "vty";
ver = "5.38";
sha256 = "0kcd3ln9xmc62ka0i7habzvjjar8z63mlvl15rdhf8hqmda0b7r7";
ver = "6.1";
sha256 = "2cefcb5764f6b662440ba9e56c30282da37071b599a7def7fc8e5679f2602bf8";
} {};
vty-crossplatform = self.callHackageDirect {
pkg = "vty-crossplatform";
ver = "0.4.0.0";
sha256 = "7b72e71b7a2e1a947f825a44a1fdea2e3e147944410c4286390aa4124a56358b";
} {};
vty-unix = self.callHackageDirect {
pkg = "vty-unix";
ver = "0.2.0.0";
sha256 = "b03a315f1aa8f70e5e3aab36b88ed2e49cd646c56b1e34c195dae13c929ca926";
} {};
reflex = self.callCabal2nix "reflex" (rp.hackGet ./dep/reflex) {};
};
Expand Down Expand Up @@ -38,7 +48,7 @@ let
};
};
nixGhc961 = (import ./dep/nixpkgs { inherit system; }).haskell.packages.ghc961.override {
overrides = self: super: {
overrides = self: super: commonOverrides self super // {

reflex = self.callCabal2nix "reflex" (rp.hackGet ./dep/reflex) {};

Expand Down Expand Up @@ -75,17 +85,11 @@ let
ver = "0.5";
sha256 = "02iyvrr7nd7fnivz78lzdchy8zw1cghqj1qx2yzbbb9869h1mny7";
} {};
vty = self.callHackageDirect {
pkg = "vty";
ver = "5.38";
sha256 = "0kcd3ln9xmc62ka0i7habzvjjar8z63mlvl15rdhf8hqmda0b7r7";
} {};


# Jailbroken until https://github.com/audreyt/string-qq/pull/3
string-qq = haskellLib.dontCheck super.string-qq;
# Tests aren't compatible with transformers-0.6
bimap = haskellLib.dontCheck super.bimap;
exception-transformers = haskellLib.doJailbreak (haskellLib.dontCheck super.exception-transformers);

};
Expand Down
9 changes: 7 additions & 2 deletions src/Reflex/Vty/Host.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import Reflex
import Reflex.Host.Class
import Reflex.Spider.Orphans ()
import qualified Graphics.Vty as V
import qualified Graphics.Vty.CrossPlatform as V

import Graphics.Vty (DisplayRegion)

-- | A synonym for the underlying vty event type from 'Graphics.Vty'. This should
Expand Down Expand Up @@ -230,5 +232,8 @@ runVtyApp app = do
-- | Returns the standard vty configuration with mouse mode enabled.
getDefaultVty :: IO V.Vty
getDefaultVty = do
cfg <- V.standardIOConfig
V.mkVty $ cfg { V.mouseMode = Just True }
cfg <- V.userConfig
vty <- V.mkVty cfg
liftIO $ V.setMode (V.outputIface vty) V.Mouse True
return vty

0 comments on commit 8fe89f1

Please sign in to comment.