ldelossa / litee.nvim

A framework for building Neovim plugins
409 stars 14 forks source link

Collapsing on leaf node could act on its parent on some cases #90

Open przepompownia opened 2 years ago

przepompownia commented 2 years ago

image It's possible that is litee-specific issue.

Expected: if the current node is a leaf or a closed tree, I would like to collapse its parent (in the example, arctgx#grep#grep).

Actual: nothing happens. To close I have to go to the parent node.

ldelossa commented 2 years ago

This can be done, but in "litee.nvim". moving the issue there.

ldelossa commented 2 years ago

Currently, nodes do not keep a reference to their parent. If they did, this would become trivial.

ldelossa commented 2 years ago

Right now ever tree has a "depth_table", this is a table that looks like this:

{ 0 = { root } 1 = { child1, child2, child3 } 2 = {child4, child5, child6 } etc... }

An immediately solution would be to grab the depth_table from the tree to find the parent node.