From 057bd630d804c37b8094b5e9f35f93eb77c4b9e6 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 25 Jun 2021 13:01:08 +0900 Subject: Simplify selection rendering by injecting highlight scopes --- helix-view/src/theme.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'helix-view') 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 { + self.scopes().iter().position(|s| s == scope) + } } #[test] -- cgit v1.2.3-70-g09d2