aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-01-09 15:40:02 +0000
committerBlaž Hrastnik2022-01-23 07:04:12 +0000
commit24314bd844d1900252f108968b39dfa4c800ca92 (patch)
treede7e38c2ff539040a16cbab39de6b01f8ffde490 /helix-core/src
parent4b0205f690ab28032c2e92498c4a7f548a2de6cb (diff)
Only call scopes.load() once
Diffstat (limited to 'helix-core/src')
-rw-r--r--helix-core/src/syntax.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index b0c5e43a..7359416d 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -462,12 +462,11 @@ impl Syntax {
let mut queue = VecDeque::new();
queue.push_back(self.root);
+ let scopes = self.loader.scopes.load();
let injection_callback = |language: &str| {
self.loader
.language_configuration_for_injection_string(language)
- .and_then(|language_config| {
- language_config.highlight_config(&self.loader.scopes.load())
- })
+ .and_then(|language_config| language_config.highlight_config(&scopes))
};
// Convert the changeset into tree sitter edits.