aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-06-25 04:01:08 +0000
committerBlaž Hrastnik2021-06-27 14:28:22 +0000
commit057bd630d804c37b8094b5e9f35f93eb77c4b9e6 (patch)
tree8c8329703fa34638c6aa8306972f3ebc582f2fdf /helix-view/src
parent44566ea812eed023c89ab49b59f62e76ef2bd6c7 (diff)
Simplify selection rendering by injecting highlight scopes
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/theme.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs
index 947c6ee0..ece4fe9a 100644
--- a/helix-view/src/theme.rs
+++ b/helix-view/src/theme.rs
@@ -215,6 +215,10 @@ impl Theme {
pub fn scopes(&self) -> &[String] {
&self.scopes
}
+
+ pub fn find_scope_index(&self, scope: &str) -> Option<usize> {
+ self.scopes().iter().position(|s| s == scope)
+ }
}
#[test]