How do views, trees, and nodes work and how are they used? #11381
Replies: 1 comment 1 reply
-
After reading the tree definition probably the best place to learn more is the tests: https://github.com/helix-editor/helix/blob/master/helix-view%2Fsrc%2Ftree.rs#L726 for a brief explanation the tree only handles views on buffers or what is sometimes called splits. Nodes are either a Container which has a certain size and what type of split it is (horizontal vertical) and a vec of children nodes (this can either be more containers or a view). Then the other type of nodes is a view which as I said before are the actual views onto the buffer and has a reference to a document and some history stored on it. The tree doesn't handle any other UI elements(file pickers, popups) that's handled by the compositor and component system within it. Also see the architecture docs: https://github.com/helix-editor/helix/blob/master/docs/architecture.md |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm curious what views and all that actually do, how you know and set which is focused, etc. I've only seen one actual call of self.tree.insert(...) so I wonder what the tree actually does. Here's my guess: each different UI part like the editor and a file picker is a different view? Not sure. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions