Skip to content

Commit

Permalink
Merge pull request #24 from ynqa/promkit/v0.4.2/main
Browse files Browse the repository at this point in the history
v0.4.2
  • Loading branch information
ynqa authored May 19, 2024
2 parents 9c2a931 + a9c6544 commit fba7c2f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Put the package in your `Cargo.toml`.

```toml
[dependencies]
promkit = "0.4.1"
promkit = "0.4.2"
```

## Features
Expand Down
2 changes: 1 addition & 1 deletion promkit-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ anyhow = "1.0.81"
crossterm = { version = "0.27.0", features = ["use-dev-tty", "event-stream"] }
futures = "0.3.30"
futures-timer = "3.0.3"
promkit = "0.4.0"
promkit = "=0.4.0"
tokio = { version = "1.36.0", features = ["full"] }
2 changes: 1 addition & 1 deletion promkit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "promkit"
version = "0.4.1"
version = "0.4.2"
authors = ["ynqa <[email protected]>"]
edition = "2021"
description = "A toolkit for building your own interactive command-line tools"
Expand Down
10 changes: 8 additions & 2 deletions promkit/src/core/listbox/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,21 @@ impl PaneFactory for State {
.filter(|(i, _)| *i >= self.listbox.position() && *i < self.listbox.position() + height)
.map(|(i, item)| {
if i == self.listbox.position() {
StyledGraphemes::from_iter([&StyledGraphemes::from(&self.cursor), item])
let init =
StyledGraphemes::from_iter([&StyledGraphemes::from(&self.cursor), item]);
if let Some(style) = &self.active_item_style {
init.apply_style(*style)
} else {
init
}
} else {
let init = StyledGraphemes::from_iter([
&StyledGraphemes::from(
" ".repeat(StyledGraphemes::from(&self.cursor).widths()),
),
item,
]);
if let Some(style) = &self.active_item_style {
if let Some(style) = &self.inactive_item_style {
init.apply_style(*style)
} else {
init
Expand Down
18 changes: 9 additions & 9 deletions promkit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
//!
//! ```toml
//! [dependencies]
//! promkit = "0.4.1"
//! promkit = "0.4.2"
//! ```
//!
//! ## Features
//!
//! - Support cross-platform both UNIX and Windows owing to [crossterm](https://github.com/crossterm-rs/crossterm)
//! - Various building methods
//! - Preset; Support for quickly setting up a UI by providing simple parameters.
//! - [Readline](https://github.com/ynqa/promkit/tree/v0.4.1#readline)
//! - [Confirm](https://github.com/ynqa/promkit/tree/v0.4.1#confirm)
//! - [Password](https://github.com/ynqa/promkit/tree/v0.4.1#password)
//! - [Select](https://github.com/ynqa/promkit/tree/v0.4.1#select)
//! - [QuerySelect](https://github.com/ynqa/promkit/tree/v0.4.1#queryselect)
//! - [Checkbox](https://github.com/ynqa/promkit/tree/v0.4.1#checkbox)
//! - [Tree](https://github.com/ynqa/promkit/tree/v0.4.1#tree)
//! - [Readline](https://github.com/ynqa/promkit/tree/v0.4.2#readline)
//! - [Confirm](https://github.com/ynqa/promkit/tree/v0.4.2#confirm)
//! - [Password](https://github.com/ynqa/promkit/tree/v0.4.2#password)
//! - [Select](https://github.com/ynqa/promkit/tree/v0.4.2#select)
//! - [QuerySelect](https://github.com/ynqa/promkit/tree/v0.4.2#queryselect)
//! - [Checkbox](https://github.com/ynqa/promkit/tree/v0.4.2#checkbox)
//! - [Tree](https://github.com/ynqa/promkit/tree/v0.4.2#tree)
//! - Combining various UI components.
//! - They are provided with the same interface, allowing users to choose and
//! assemble them according to their preferences.
Expand All @@ -39,7 +39,7 @@
//!
//! ## Examples/Demos
//!
//! See [here](https://github.com/ynqa/promkit/tree/v0.4.1#examplesdemos)
//! See [here](https://github.com/ynqa/promkit/tree/v0.4.2#examplesdemos)
//!
//! ## Why *promkit*?
//!
Expand Down

0 comments on commit fba7c2f

Please sign in to comment.