Skip to content

feat: Allow to expand nodes until certain condition is met #3166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ghostbuster91
Copy link
Contributor

@ghostbuster91 ghostbuster91 commented Jul 20, 2025

This closes #2789

It took me a while but here I am :) I decided to create a fresh one as it was easier then resolving conflicts on the old one.

For now bare minimum of the changes that makes it work. Once we agree how the api will look like I will add docs following what we did in #2790

---@param mode string
---@param node Node
---@param edit_opts NodeEditOpts?
local function edit(mode, node, edit_opts)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: just moved this function higher so that I can refer to it from toggle_descend_until

Api.tree.expand_all = wrap_node(actions.tree.modifiers.expand.all)

Api.tree.toggle_descend_until = wrap_node(function(node, descend_until)
Copy link
Contributor Author

@ghostbuster91 ghostbuster91 Jul 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this is actually what I would like to achieve in the end. The edit part is wrong as nodes are not getting collapsed after hitting enter for the second time. Can you advise? fixed

question: how should the end user api look like?

@alex-courtis
Copy link
Member

Thanks for getting back to this one @ghostbuster91

My time is limited, however I will get to reviewing next weekend.

FYI the nightly CI failure has been resolved on master: #3167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow nodes to expand until a certain condition is met.
2 participants