From b26e7e2e8fc900b5637d9772ecb74874e8794ecc Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 5 Jul 2022 06:44:16 -0400 Subject: Add live preview to theme picker (#1798) * Add theme picker with live preview * Add live theme preview to :theme command * cargo fmt * Fix clippy warnings * Remove picker variant * Remove unused import * Cleanup * Change current_theme to last_theme * Fix accidental comment flash deletion * Typo * Remove theme cache * Add some comments * Refactor some theme handling TIL flatmap on Option is called and_then * Remove unnecessary renames * Constrain last_theme theme preview lifecycle * Switch to bitflag implementation * Better handling of last_theme * Sort theme names * Better memory juggling * Missed a branch * Remove name from theme, switch bitand to & * cargo fmt * Update helix-view/src/editor.rs * Switch boolean to enum * Remove bitflag impl * cargo fmt * Remove un-needed type arg * cargo fmt--- helix-term/src/application.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'helix-term/src/application.rs') diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 805f660f..df14f5e3 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -108,13 +108,7 @@ impl Application { .ok() .filter(|theme| (true_color || theme.is_16_color())) }) - .unwrap_or_else(|| { - if true_color { - theme_loader.default() - } else { - theme_loader.base16_default() - } - }); + .unwrap_or_else(|| theme_loader.default_theme(true_color)); let syn_loader_conf = user_syntax_loader().unwrap_or_else(|err| { eprintln!("Bad language config: {}", err); @@ -373,13 +367,7 @@ impl Application { }) .ok() .filter(|theme| (true_color || theme.is_16_color())) - .unwrap_or_else(|| { - if true_color { - self.theme_loader.default() - } else { - self.theme_loader.base16_default() - } - }), + .unwrap_or_else(|| self.theme_loader.default_theme(true_color)), ); } -- cgit v1.2.3-70-g09d2