Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--helix-core/src/syntax.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 8fda2935..93f618c0 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -1363,13 +1363,14 @@ impl Syntax {
let depth = layer.depth + 1;
// TODO: can't inline this since matches borrows self.layers
for (config, ranges) in injections {
+ let parent = Some(layer_id);
let new_layer = LanguageLayer {
tree: None,
config,
depth,
ranges,
flags: LayerUpdateFlags::empty(),
- parent: Some(layer_id),
+ parent: None,
};
// Find an identical existing layer
@@ -1381,6 +1382,7 @@ impl Syntax {
// ...or insert a new one.
let layer_id = layer.unwrap_or_else(|| self.layers.insert(new_layer));
+ self.layers[layer_id].parent = parent;
queue.push_back(layer_id);
}