2
0
mirror of https://github.com/rivo/tview.git synced 2024-11-12 19:10:28 +00:00

Don't throw away nodes after drawing TreeView

Relates to #283
This commit is contained in:
Nick Krichevsky 2019-06-15 22:19:38 -04:00
parent b62197ade4
commit a186f0a909
No known key found for this signature in database
GPG Key ID: A7567E699BE5AAE4

View File

@ -562,13 +562,7 @@ func (t *TreeView) Draw(screen tcell.Screen) {
return
}
// Build the tree if necessary.
if t.nodes == nil {
t.process()
}
defer func() {
t.nodes = nil // Rebuild during next call to Draw()
}()
t.process()
// Scroll the tree.
x, y, width, height := t.GetInnerRect()