Skip to content
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

Use vim/neovim builtin keybinding to open/close tree node #84

Open
leaxoy opened this issue Jan 4, 2022 · 4 comments
Open

Use vim/neovim builtin keybinding to open/close tree node #84

leaxoy opened this issue Jan 4, 2022 · 4 comments

Comments

@leaxoy
Copy link

leaxoy commented Jan 4, 2022

Now, this plugin use zo open tree node, zc close tree node. But no keymap to toggle tree node.
So I think it's better to use za toggle tree node like fold.

@leaxoy
Copy link
Author

leaxoy commented Jan 4, 2022

zA toggle all fold under cursor recursively
za toggle current fold under cursor
zC close all fold under cursor recursively
zc close current fold
zO open all fold under cursor resursively
zo open current fold
zR open all fold among whole tree

@ldelossa
Copy link
Owner

ldelossa commented Jan 4, 2022

I generally like the toggle command.

Things get a bit more complicated when we deal with recursive opens. I dont think these are a good idea in most cases.

In the calltree case, loops can exist, and recursive opens can lead to the open never finishing.

In filetree, directories are lazily evaluated, so recursive open of them can result in a long wait as you open a heavily nested directory.

The recursive close operations should be okay.

@leaxoy
Copy link
Author

leaxoy commented Jan 5, 2022

Sorry, I didn't fully consider this situation, zA can be reserved, but za is conveniently to toggle fold.

@ldelossa
Copy link
Owner

ldelossa commented Jan 5, 2022

Yup I agree, a toggle will be useful.

Ill create a pr at each plugin repo (calltree,filetree,symboltree) to accomplish this.

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

No branches or pull requests

2 participants