summaryrefslogtreecommitdiff
path: root/helix-view/src/theme.rs
diff options
context:
space:
mode:
authorA-Walrus2022-10-08 18:28:42 +0000
committerGitHub2022-10-08 18:28:42 +0000
commitc15f1ea274d300feb23208324aa5b27d7274bebd (patch)
treef606f8a30b0e9061c35f9af83b791771a5931946 /helix-view/src/theme.rs
parent18cfe864f44e9d97f11335b7db14e28c804ea794 (diff)
Add cursorcolumn (#4084)
* Implement cursorcolumn * Add documentation * Separate column style from line with fallback * Fallback to cursorcolumn first * Switch to non-fallback try_get_exact Add new function `try_get_exact`, which doesn't perform fallback, and use that instead because the fallback behaviour is being handled manually.
Diffstat (limited to 'helix-view/src/theme.rs')
-rw-r--r--helix-view/src/theme.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs
index 85f5cc13..8a1f8b7e 100644
--- a/helix-view/src/theme.rs
+++ b/helix-view/src/theme.rs
@@ -277,6 +277,13 @@ impl Theme {
.find_map(|s| self.styles.get(s).copied())
}
+ /// Get the style of a scope, without falling back to dot separated broader
+ /// scopes. For example if `ui.text.focus` is not defined in the theme, it
+ /// will return `None`, even if `ui.text` is.
+ pub fn try_get_exact(&self, scope: &str) -> Option<Style> {
+ self.styles.get(scope).copied()
+ }
+
#[inline]
pub fn scopes(&self) -> &[String] {
&self.scopes