We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a87f3dd commit 3789835Copy full SHA for 3789835
internal/views/splits.go
@@ -483,7 +483,15 @@ func (n *Node) Unsplit() bool {
483
// flattens the tree by removing unnecessary intermediate parents that have only one child
484
// and handles the side effect of it
485
func (n *Node) flatten() {
486
- if n.parent == nil || len(n.children) != 1 {
+ if len(n.children) != 1 {
487
+ return
488
+ }
489
+
490
+ // Special case for root node
491
+ if n.parent == nil {
492
+ *n = *n.children[0]
493
+ n.parent = nil
494
+ n.Kind = STUndef
495
return
496
}
497
0 commit comments