-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: spinner eating the screen, also dont clear rest of screen since its not needed anymore fix: confirm, select and multi select help text being eaten by spinner chore: update tests chore: example fix: typo * chore: renamed prompts_in_spinner.rs -> spinner-prompts.rs * feat: custom themeable cursor for Input prompt fix: spinner eating input prompt * chore: fix tests * refactor: rename unclear var * fix: cursor rendering on success * fix: cursor rendering after placeholder * fix: spinner eating input success prompt chore: update example * chore: fix tests * fix: cursor color not being reset when input is empty and there isnt a placeholder or suggestion * fix: missing space chore: remove commented code fix: doc comment was a normal comment
- Loading branch information
Showing
7 changed files
with
233 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use demand::{Confirm, DemandOption, Input, MultiSelect, Select, Spinner, Theme}; | ||
|
||
fn main() { | ||
let spinner = Spinner::new("im out here"); | ||
spinner | ||
.run(|| { | ||
Confirm::new("confirm") | ||
.description("it says confirm") | ||
.run() | ||
.unwrap(); | ||
Input::new("input ") | ||
.description("go on say something") | ||
.suggestions(vec!["hello there"]) | ||
.validation(|s| match !s.contains('j') { | ||
true => Ok(()), | ||
false => Err("ew stinky 'j' not welcome here"), | ||
}) | ||
.theme(&Theme::catppuccin()) | ||
.placeholder("Words go here") | ||
.run() | ||
.unwrap(); | ||
Select::new("select") | ||
.description("hi") | ||
.options(vec![ | ||
DemandOption::new("hi"), | ||
DemandOption::new("hello"), | ||
DemandOption::new("how are you"), | ||
]) | ||
.run() | ||
.unwrap(); | ||
MultiSelect::new("more select") | ||
.description("hewo") | ||
.options(vec![ | ||
DemandOption::new("hi"), | ||
DemandOption::new("hello"), | ||
DemandOption::new("how are you"), | ||
]) | ||
.run() | ||
.unwrap(); | ||
// Spinner::new("spinnerception") | ||
// .run(|| std::thread::sleep(std::time::Duration::from_secs(1))) | ||
}) | ||
.unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.