aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/theme.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs
index efb6a1af..51a21421 100644
--- a/helix-view/src/theme.rs
+++ b/helix-view/src/theme.rs
@@ -200,12 +200,14 @@ fn parse_modifier(value: &Value) -> Option<Modifier> {
impl Theme {
pub fn get(&self, scope: &str) -> Style {
- self.styles
- .get(scope)
- .copied()
+ self.try_get(scope)
.unwrap_or_else(|| Style::default().fg(Color::Rgb(0, 0, 255)))
}
+ pub fn try_get(&self, scope: &str) -> Option<Style> {
+ self.styles.get(scope).copied()
+ }
+
#[inline]
pub fn scopes(&self) -> &[String] {
&self.scopes