-
Notifications
You must be signed in to change notification settings - Fork 255
feat: add same_level config option #522
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
Conversation
This seems like a reasonable addition. I do think the option name could be clearer. Maybe we can call the option something like "target" or "destination" and make the option value "child" by default or "sibling" for the behavior you want. Or to keep it a boolean, make it "always_paste_as_sibling" or something else descriptive. |
In this case, you can actually have both and the new option would affect what the default path is when "show_path" is used. |
@zenoli @cseickel Considering the usefulness, I will say yes: I once wanted to create many "sibling" folders. but then I will need to manually move the cursor onto any non-folder node under the current parent. But it is possible that there is no non-folder node under the current parent. So, this PR will be useful for me when it is merged. Regarding naming: How about |
Awesome, thanks for the feedback! |
2af113c
to
11870a6
Compare
Hey :-) I assume this is because
Am I correct with this assumption? And on another note: |
True, but neo-tree does have the ability to distinguish this. It is used to display a different icon for known empty directories: if node.loaded and not node:has_children() then -- empty folder neo-tree.nvim/lua/neo-tree/sources/common/components.lua Lines 264 to 270 in e968cda
That's sounds reasonable. |
d128161
to
4c21cf6
Compare
00c901e
to
a2491da
Compare
a2491da
to
d22fd6a
Compare
Hi, first of all, thanks for this amazing plugin!
This is my first contribution and I kept the PR minimal because I want to first assess whether this feature is even wanted before diving deeper into the setup.
I propose to add a
same_level
boolean config option to control the behaviour on how created/pasted/moved files/directories get inserted into the tree:The behaviour is only affected if the cursor during creation/pasting/moving is on a directory node. Currently, the items get inserted inside the directory under cursor. I personally find it more intuitive if they get inserted on the same level (i.e. "as siblings") to the directory under cursor, much like it behaves currently when the cursor is on a file.
If you think this feature is worth continuing to work on let me know. If no, feel free to decline the PR. If yes, I would also like to add the
same_level
flag withing theconfig
table of the specific commands (i.e. next toconfig.show_path
which would take precedence over the globalsame_level
options.