From 1c69461efa1e71ba092c67ce65d6aea28616dd0e Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Mon, 18 Jan 2021 10:50:55 -0800 Subject: [PATCH] Use wasmer_enumset --- CHANGELOG.md | 9 ++++++++- cursive-core/Cargo.toml | 4 ++-- cursive-core/src/lib.rs | 2 ++ cursive/Cargo.toml | 2 +- cursive/src/lib.rs | 2 ++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ac3c5b..9be77f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - Backends are now initialized when starting the event loop rather than when creating Cursive. - As a result initialization and runner functions have changed. +- `ColorStyle::color` is no longer an optional. Use `ColorType::InheritParent` if needed. +- Replaced `()` error types with some custom zero-sized types. ### API updates @@ -25,12 +27,18 @@ - Add `SpannedString::trim(_{start, end})` to remove the unused prefix, suffix or both of the source. - Add `SpannedString::spans(_raw)_attr_mut` to give mutable access to the attribute of the spans. - Add `TextContent::with_content` to give mutable access to the `StyledString` of a `TextView`. +- Add `ColotyType::InheritParent` to carry over the front or back color from the parent. +- Add `Effect::Blink`. +- Add `Margins::zeros()`. +- Add `TextView::set_style`. +- Add `SpannedString`-shrinking methods. ### Improvements - `ListView` now supports children taller than 1 row. - Added an `autocomplete` example. - Added a `stopwatch` example. +- `SpannedString` iterators are now double-ended and exact-sized. ### Bugfixes @@ -41,7 +49,6 @@ - Dispatch `call_on_*` methods to all screens. - Fix potential issue with `setlocale` in ncurses backend on BSD. - Fix handling of multi-bytes newlines characters. -- Fix ### Doc diff --git a/cursive-core/Cargo.toml b/cursive-core/Cargo.toml index 8ee2791..6fc1fa8 100644 --- a/cursive-core/Cargo.toml +++ b/cursive-core/Cargo.toml @@ -22,10 +22,10 @@ repository = "gyscos/cursive" [dependencies] enum-map = "0.6" -enumset = "1" +wasmer_enumset = "1" log = "0.4" owning_ref = "0.4" -syn = "=1.0.57" # Pin syn to 1.0.57 since enumset currently incompatible with 1.0.58 +syn = "1.0" unicode-segmentation = "1" unicode-width = "0.1" xi-unicode = "0.3" diff --git a/cursive-core/src/lib.rs b/cursive-core/src/lib.rs index 514c9b5..234f6ce 100644 --- a/cursive-core/src/lib.rs +++ b/cursive-core/src/lib.rs @@ -9,6 +9,8 @@ //! [`cursive`]: https://docs.rs/cursive #![deny(missing_docs)] +extern crate wasmer_enumset as enumset; + macro_rules! new_default( ($c:ident<$t:ident>) => { impl<$t> Default for $c<$t> { diff --git a/cursive/Cargo.toml b/cursive/Cargo.toml index 8e00a7d..f3535c5 100644 --- a/cursive/Cargo.toml +++ b/cursive/Cargo.toml @@ -18,7 +18,7 @@ features = ["unstable_scroll", "markdown", "toml"] cursive_core = { path = "../cursive-core", version="0.1.1-alpha.0" } crossbeam-channel = "0.5" cfg-if = "1" -enumset = "1" +wasmer_enumset = "1" unicode-segmentation = "1" unicode-width = "0.1" lazy_static = "1" diff --git a/cursive/src/lib.rs b/cursive/src/lib.rs index 8d12d3a..33071e1 100644 --- a/cursive/src/lib.rs +++ b/cursive/src/lib.rs @@ -64,6 +64,8 @@ //! [`cursive::theme`]: ./theme/index.html #![deny(missing_docs)] +extern crate wasmer_enumset as enumset; + pub use cursive_core::*; mod utf8;