From 9f318a852909439190050a0cd157938477f4639b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 8 Apr 2021 16:53:57 +0900 Subject: [PATCH] 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. --- helix-view/src/tree.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helix-view/src/tree.rs b/helix-view/src/tree.rs index 6204ba415..e48f376a4 100644 --- a/helix-view/src/tree.rs +++ b/helix-view/src/tree.rs @@ -163,7 +163,8 @@ pub fn split(&mut self, view: View, layout: Layout) -> ViewId { 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] {