-
Notifications
You must be signed in to change notification settings - Fork 329
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
draft rename #197
draft rename #197
Conversation
So I got the prompt for replacing files working, however, currently it does not change the selection. Therefore, to see the file info (after renaming) you must manually The prompt works by caching the rename oldpath and newpath and using that after getting an answer for prompt. |
Now also a prompt for making a new directory works. All is left to do is move the selection to the newly renamed file. |
@JurisMajors I tried this patch and it seems to be working fine. I think we should also allow overwriting |
@gokcehan Hey, I did put some time in to this now, the renewing works (without |
@JurisMajors Sorry, I have been quite busy and I couldn't get back to this. This is likely due to directory reloading being an asynchronous operation. There is an ugly hack in |
@gokcehan I tried to do some steps manually, like cd'ing in the directory, removing directory from cache, then calling nav.loadDir on it. However, dir.loading never goes to false in that scenario (which is weird way of implementing it) and then after wards call dir.sel(). This way attempting to wait for the directory to be loaded and only then do the select call. Thing I have not tried yet is loading the directory myself and updating the file list, but that could get messy if new directories are created. Anyway, this seems like a weird issue to have, I'll be postponing working on this until you or somebody else either does a half-working solution or a working solution on which I can then continue work on top and possibly improve it. |
@JurisMajors Sorry for dragging this too long. I think we can merge this as it is and we can work on file selection later on. I had tried something along the line:
The thing is, the way I described it, it should already be working with It seems that the documentation update is missing in your patch. We can merge this and I can update the documentation if you want. Also do you think we should change the default keybinding to |
@gokcehan I had the |
Done:
TODO:
Prompt for creating parent directories
Prompting for creating the parent directories could get messy with current structure, let me know if we want to do that at all or if you have any nice ideas on how to do it.
Moving the file selection to the renamed file with
app.nav.sel
, I could not get it working, if you have any ideas let me know.