From 9253e4f0df946c537d40ec237cb121ed65841078 Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Sun, 19 May 2019 19:52:39 -0400 Subject: [PATCH] Select the first node as the real first node --- tree.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree.go b/tree.go index 2e7cae2..ed4c443 100644 --- a/tree.go +++ b/tree.go @@ -50,7 +50,7 @@ func (tree *TreeWidget) Draw(buffer *termui.Buffer) { func (tree *TreeWidget) AddRootNode(node *Node) { tree.rootNodes = append(tree.rootNodes, node) if len(tree.rootNodes) == 1 { - tree.selectedNode = node.children[0] + tree.selectedNode = node } node.setTree(tree) }