-
Notifications
You must be signed in to change notification settings - Fork 270
Description
I am having some issues understanding how sources are "meant" to rerender their tree on a navigate
event.
I am currently having navigate called for all open events and it turns out that is incorrect and bad behavior (which is why my state is constantly being reset). Taking a look at how other sources manage this, they seem to have their own open
function that is called with the various open
commands.
Cool, makes sense to me. However, I cannot seem to figure out how to rerender the tree state as it was "previously" when a user left the source.
The wording here might not make a ton of sense so pictures are good.
A user navigates to something within the Netman
source.
And then they navigate back to the Netman
source.
Of course this is my code doing this, but I don't understand the "proper" way to rerender the tree back out, so I just have it redoing the entire start of the tree again. What is most frustrating is I can see the tree has the nodes still in it from the previous state. In fact, attempting to add one of those nodes back to the tree with the same ID throws a fun error stating its already in the tree (because of course, it is). However, I cannot get the tree associated with the state to render back into the buffer.
I have attempted the following things
- Extracting the nodes from the tree and readding the entire tree
- Ended up with the fun above error of "This node is already in the tree"
- Simply calling
require("neo-tree.ui").renderer.redraw(state)
- This just closed the Neo-tree buffer and left me with an empty buffer
- Calling
state.tree:render()
- This throws an error stating the buffer ID is invalid.
I'm sure this is simple but god help me if I can't figure this out. What am I missing?