Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ColorfulTheme.inline_selections #277

Merged
merged 1 commit into from Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
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
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