Skip to content

Commit

Permalink
fix: spinner eating input success prompt
Browse files Browse the repository at this point in the history
chore: update example
  • Loading branch information
Vulpesx committed Apr 27, 2024
1 parent f27e236 commit 4589333
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions examples/spinner-prompts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ fn main() {
.description("it says confirm")
.run()
.unwrap();
Input::new("input:")
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())
.theme(&Theme::catppuccin())
.placeholder("Words go here")
.run()
.unwrap();
Select::new("select")
Expand Down
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ impl<'a> Input<'a> {
out.set_color(&self.theme.title)?;
write!(out, " {}", self.title)?;
out.set_color(&self.theme.selected_option)?;
write!(out, "{}", self.input)?;
writeln!(out, "{}", self.input)?;
out.reset()?;
Ok(std::str::from_utf8(out.as_slice()).unwrap().to_string())
}
Expand Down

0 comments on commit 4589333

Please sign in to comment.