nvim-tree.lua
nvim-tree.lua copied to clipboard
Node Privacy
Nodes should not be exposed to the user. They are internal representations and should not be mutated by the user.
api.tree.get_nodes
and sort_by
return/are passed cloned partial nodes.
api.tree.get_node_under_cursor
returns the internal node. API functions that take {node}
expect a real node.
Proposal:
- add a node identifier like a UUID
- all API returns a cloned node containing UUID
- existing api that takes
{node}
maps to the internal node via identifier
1 may could achieved via absolute_path
, similar to sort_by
.
This may be achieved before or during a refactor of the {node}
consuming API to take {opts}
.