Skip to content

Commit

Permalink
Merge pull request #277 from Gordon01/remove_inline_selections
Browse files Browse the repository at this point in the history
Remove `ColorfulTheme.inline_selections`
  • Loading branch information
pksunkara authored Sep 6, 2023
2 parents af5f522 + 6be9aa7 commit 65f477b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

* Updated MSRV to `1.63.0` due to multiple dependencies on different platforms: `rustix`, `tempfile`,`linux-raw-sys`
* Removed deprecated `Confirm::with_text`
* Removed deprecated `ColorfulTheme::inline_selections`
* Prompt builder functions now take `mut self` instead of `&mut self`
* Prompt builder functions now return `Self` instead of `&mut Self`
* Prompt interaction functions now take `self` instead of `&self`
Expand Down
19 changes: 7 additions & 12 deletions src/theme/colorful.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ pub struct ColorfulTheme {
// Formats the highlighting if matched characters
#[cfg(feature = "fuzzy-select")]
pub fuzzy_match_highlight_style: Style,
/// Show the selections from certain prompts inline
pub inline_selections: bool,
}

impl Default for ColorfulTheme {
Expand Down Expand Up @@ -79,7 +77,6 @@ impl Default for ColorfulTheme {
fuzzy_cursor_style: Style::new().for_stderr().black().on_white(),
#[cfg(feature = "fuzzy-select")]
fuzzy_match_highlight_style: Style::new().for_stderr().bold(),
inline_selections: true,
}
}
}
Expand Down Expand Up @@ -260,15 +257,13 @@ impl Theme for ColorfulTheme {

write!(f, "{} ", &self.success_suffix)?;

if self.inline_selections {
for (idx, sel) in selections.iter().enumerate() {
write!(
f,
"{}{}",
if idx == 0 { "" } else { ", " },
self.values_style.apply_to(sel)
)?;
}
for (idx, sel) in selections.iter().enumerate() {
write!(
f,
"{}{}",
if idx == 0 { "" } else { ", " },
self.values_style.apply_to(sel)
)?;
}

Ok(())
Expand Down

0 comments on commit 65f477b

Please sign in to comment.