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

Lazy load themes #1969

Merged
merged 3 commits into from
Dec 6, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Panic with a message if even the default theme is missing
  • Loading branch information
Enselic committed Dec 1, 2021
commit 544ad4b767609c8e38802904e942786418f3aec4
6 changes: 4 additions & 2 deletions src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ impl HighlightingAssets {
if !theme.is_empty() {
bat_warning!("Unknown theme '{}', using default.", theme)
}
&self.get_theme_set().themes
[self.fallback_theme.unwrap_or_else(|| Self::default_theme())]
self.get_theme_set()
.themes
.get(self.fallback_theme.unwrap_or_else(|| Self::default_theme()))
.expect("something is very wrong if the default theme is missing")
}
}
}
Expand Down