Skip to content

Is there expand_all_subnodes? #777

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

Closed
phantomlsh opened this issue Feb 27, 2023 · 3 comments · Fixed by #1767
Closed

Is there expand_all_subnodes? #777

phantomlsh opened this issue Feb 27, 2023 · 3 comments · Fixed by #1767
Assignees
Labels
enhancement New feature or request

Comments

@phantomlsh
Copy link

I have seen the built-in action close_all_subnodes, but the expand_all_subnodes seems to be missing. How can we expand one directory recursively?

@phantomlsh phantomlsh changed the title Is there features that expand_all_subnodes? Is there expand_all_subnodes? Feb 27, 2023
@nhat-vo nhat-vo added the enhancement New feature or request label Mar 2, 2023
@nhat-vo nhat-vo self-assigned this Mar 2, 2023
@ghostbuster91
Copy link
Contributor

@paulroseau
Copy link

paulroseau commented Aug 21, 2023

Hi,

@ghostbuster91 suggested solution didn't work exactly as intended for me. I had keep pressing the corresponding key to expand the node one extra level each time while I wanted all the sub directories to be expanded at once.

Looking into the code to debug it I found that the implementation already exists.

Here is my solution for those coming around here before this makes its way into the plugin:

local function open_all_subnodes(state)
  local node = state.tree:get_node()
  local filesystem_commands = require("neo-tree.sources.filesystem.commands")
  filesystem_commands.expand_all_nodes(state, node)
end

require("neo-tree").setup({
  window = {
    mappings = {
      ["O"] = open_all_subnodes,
    },
  },
})

paulroseau pushed a commit to paulroseau/dotfiles that referenced this issue Aug 21, 2023
@ghostbuster91
Copy link
Contributor

@paulroseau Sorry, I forgot to follow up here. Yes that solution got broken at some point. I then fixed it in #957

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

Successfully merging a pull request may close this issue.

4 participants