on master help sign in
Only call scopes.load() once
24314bdBlaž Hrastnik
helix-core/src/syntax.rs+2−3
@@ -462,12 +462,11 @@ impl Syntax {
462 let mut queue = VecDeque::new();
462 let mut queue = VecDeque::new();
463 queue.push_back(self.root);
463 queue.push_back(self.root);
464
464
465+ let scopes = self.loader.scopes.load();
465 let injection_callback = |language: &str| {
466 let injection_callback = |language: &str| {
466 self.loader
467 self.loader
467 .language_configuration_for_injection_string(language)
468 .language_configuration_for_injection_string(language)
468− .and_then(|language_config| {
469− language_config.highlight_config(&self.loader.scopes.load())
469+ .and_then(|language_config| language_config.highlight_config(&scopes))
470− })
471 };
470 };
472
471
473 // Convert the changeset into tree sitter edits.
472 // Convert the changeset into tree sitter edits.