From 6e658aae1c05fdd9f9ee36b39a948028bcaad446 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 14 Oct 2020 18:07:42 +0900 Subject: Auto-indent on enter based on tree-sitter scopes. --- helix-core/src/syntax.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'helix-core/src/syntax.rs') 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> { + self.language_configs + .iter() + .find(|config| config.scope == scope) + .cloned() + } } // -- cgit v1.2.3-70-g09d2