aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/syntax.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-10-14 09:07:42 +0000
committerBlaž Hrastnik2020-10-14 09:07:42 +0000
commit6e658aae1c05fdd9f9ee36b39a948028bcaad446 (patch)
tree7d703103fbf12f64928a72746cd8c6aa29260c42 /helix-core/src/syntax.rs
parent6ae3c26def0e4fe4b3e4ce21f1e8d569c627e738 (diff)
Auto-indent on enter based on tree-sitter scopes.
Diffstat (limited to 'helix-core/src/syntax.rs')
-rw-r--r--helix-core/src/syntax.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 290f2652..02903637 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -135,6 +135,13 @@ impl Loader {
// TODO: content_regex handling conflict resolution
}
+
+ pub fn language_config_for_scope(&self, scope: &str) -> Option<Arc<LanguageConfiguration>> {
+ self.language_configs
+ .iter()
+ .find(|config| config.scope == scope)
+ .cloned()
+ }
}
//