on master help sign in
Only call scopes.load() once
commit24314bd844d1900252f108968b39dfa4c800ca92 authorBlaž Hrastnik <blaz@mxxn.io> dateMon 10 Jan 2022, 00:40 (5 years ago) parent4b0205f
1 file changed+2−3
helix-core/src/syntax.rs+2−3
helix-core/src/syntax.rs+2−3
@@ -462,12 +462,11 @@ impl Syntax {
462462 let mut queue = VecDeque::new();
463463 queue.push_back(self.root);
464464
465+ let scopes = self.loader.scopes.load();
465466 let injection_callback = |language: &str| {
466467 self.loader
467468 .language_configuration_for_injection_string(language)
468− .and_then(|language_config| {
469− language_config.highlight_config(&self.loader.scopes.load())
470− })
469+ .and_then(|language_config| language_config.highlight_config(&scopes))
471470 };
472471
473472 // Convert the changeset into tree sitter edits.