-
-
Notifications
You must be signed in to change notification settings - Fork 617
Allow creating directories when renaming files (behavior like create file) #2630
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
Comments
This could be added to any similar operation we find. |
This could be implemented, but it also produces a problem of typos being enhanced If a user wants to rename a file and make it go into a long nested directory. |
Indeed. We can't really warn as it's not possible to determine the user's desired behaviour. We can use |
* Added creating of directories when renaming files * Style check error? fixed * Forgot, I added back the line of code that creates a directory named as the file and forgot to remove it * Added a check for file already exists and also switched the is_error values as they were mismatched * I don't know how but this somehow fixed the creation of a directory?
Is your feature request related to a problem? Please describe.
I recently discovered that it is currently not possible to rename a file and move it to another folder via nvim-tree's rename operation. I had hoped it worked the way creating files works where you can use
foo/bar
to create a new folderfoo
with abar
file inside it. Rename just creates a file calledfoo/bar
instead.Describe the solution you'd like
When renaming a file
./bar
I want to be able to edit the "file name" to./foo/bar
and have the file be nested in the created folder.Describe alternatives you've considered
A colleague mentioned that VSCode had this feature when renaming files.
Additional context
The issue is not a big deal but I expected the two operations "rename" and "create" to be similar in behavior. Could this be done in a similar way in the code? I think the folder creation happens in this loop.
Thanks for considering and keep up the great work! 🙂
The text was updated successfully, but these errors were encountered: