@@ -393,20 +393,23 @@ impl Application {
394 /// Refresh theme after config change
394 /// Refresh theme after config change
395 fn refresh_theme(&mut self, config: &Config) -> Result<(), Error> {
395 fn refresh_theme(&mut self, config: &Config) -> Result<(), Error> {
396− if let Some(theme) = config.theme.clone() {
396+ let true_color = config.editor.true_color || crate::true_color();
397− let true_color = self.true_color();
397+ let theme = config
398− let theme = self
400+ .and_then(|theme| {
399− .theme_loader
401+ self.theme_loader
400− .load(&theme)
402+ .load(theme)
401− .map_err(|err| anyhow::anyhow!("Failed to load theme `{}`: {}", theme, err))?;
404+ log::warn!("failed to load theme `{}` - {}", theme, e);
403− if true_color || theme.is_16_color() {
408+ .filter(|theme| (true_color || theme.is_16_color()))
404− self.editor.set_theme(theme);
409+ })
405− } else {
410+ .unwrap_or_else(|| self.theme_loader.default_theme(true_color));
406− anyhow::bail!("theme requires truecolor support, which is not available")
412+ self.editor.set_theme(theme);
@@ -431,10 +434,6 @@ impl Application {
434− fn true_color(&self) -> bool {
435− self.config.load().editor.true_color || crate::true_color()
438 #[cfg(windows)]
437 #[cfg(windows)]
439 // no signal handling available on windows
438 // no signal handling available on windows
440 pub async fn handle_signals(&mut self, _signal: ()) {}
439 pub async fn handle_signals(&mut self, _signal: ()) {}