Skip to content

Commit

Permalink
fix: confirm - description should render on new line
Browse files Browse the repository at this point in the history
  • Loading branch information
roele committed Jan 23, 2024
1 parent c57e6ab commit 58b2b40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,11 @@ impl<'a> Confirm<'a> {
let mut out = Buffer::ansi();

out.set_color(&self.theme.title)?;
write!(out, " {}", self.title)?;
writeln!(out, " {}", self.title)?;

if !self.description.is_empty() {
out.set_color(&self.theme.description)?;
write!(out, " {}", self.description)?;
writeln!(out)?;
}
writeln!(out, "\n")?;

Expand Down Expand Up @@ -217,8 +216,8 @@ mod tests {

assert_eq!(
indoc! {
" Are you sure? This will do a thing.
" Are you sure?
This will do a thing.
Yes! No.
Expand Down
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{theme, Theme};
/// .description("We'll use this to personalize your experience.")
/// .placeholder("Enter your name");
/// let name = input.run().expect("error running input");
/// ````
/// ```
pub struct Input<'a> {
/// The title of the input
pub title: String,
Expand Down

0 comments on commit 58b2b40

Please sign in to comment.