Select the first node as the real first node

This commit is contained in:
Nick Krichevsky 2019-05-19 19:52:39 -04:00
parent 234b80b79f
commit 9253e4f0df

View file

@ -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)
}