nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua
Other
7.16k stars 611 forks source link

Partial Collapse #2119

Open alex-courtis opened 1 year ago

alex-courtis commented 1 year ago

2112

Method to recursively collapse a partial tree up to the root level folder.

As per collapse_all but within one sub-tree.

Recursively collapse a node. As per open.edit on an open node however also recursively collapses contents.

alex-courtis commented 1 year ago

I'm leaning towards collapse with the same param as collapse_all.

mikehaertl commented 1 year ago

... collapse a partial tree up to the root level folder

I want to make sure that we talked about the same behavior.

When I have this start condition:

image

If the cursor is on folder b/ or on file b/demo it should collapse any directory below b/ including b/ itself:

image

It could be an option (e.g. collapse({parents = true})) to also collapse all parents up to the root instead:

image

alex-courtis commented 1 year ago

If the cursor is on folder b/ or on file b/demo it should collapse any directory below b/ including b/ itself:

I see... that is the minimum required functionality. Updating description.

It could be an option (e.g. collapse({parents = true})) to also collapse all parents up to the root instead:

YAGNI. We can add it later if necessary.

jensenojs commented 1 year ago

looking forward to it(

image