aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-04-08 07:53:57 +0000
committerBlaž Hrastnik2021-04-08 13:34:06 +0000
commit9f318a852909439190050a0cd157938477f4639b (patch)
tree77e6712c0a90d75cea43eb164a331d39530287ea
parent9ca2909c80ff95b1dd4a1d92b7144d7bbfce3ca6 (diff)
Fix an issue with closing nested splits.
The parent id was never assigned to the split, so removing the container when it became empty failed.
-rw-r--r--helix-view/src/tree.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-view/src/tree.rs b/helix-view/src/tree.rs
index 6204ba41..e48f376a 100644
--- a/helix-view/src/tree.rs
+++ b/helix-view/src/tree.rs
@@ -163,7 +163,8 @@ impl Tree {
container.children.insert(pos, node);
self.nodes[node].parent = parent;
} else {
- let split = Node::container(layout);
+ let mut split = Node::container(layout);
+ split.parent = parent;
let split = self.nodes.insert(split);
let container = match &mut self.nodes[split] {