I've only just found this feature, which would be very handy - but it doesn't appear to work. Gives message "Failed to rename sketch folder", and doesn't change anything.
Up until now, if I wanted to change a name, I'd save with that new name (which places it in a folder of the same name) and then have the chore of deleting the old one. This tool would be much easier. Do others get same problem with it please?
I just happened to be exploring the other feature that's new to me, namely organising a sketch into tabs, when I took the screenshot. Should have avoided the ambiguity
Is there any difference? If you rename the first tab the sketch itself ( including the sketch directory ) is renamed. At least that's how my IDE ( 1.8.15 ) does it.
I think I've discovered the cause. The IDE apparently assumes that the sketch's folder is also open. That's often the case, but certainly not always for me, especially if I'm working with several sketches.
We're thinking along the same lines. It occurred to me after posting that it might be a path length issue. The one that failed was 118 characters long. I copied it to a higher folder (still in my Dropbox parent folder) and it renamed OK.
I'll report back if/when I find the critical max path length.
Bizarre behaviour. Couldn't reproduce that last test. Or several others, including outside the Dropbox folder. For example I saved a new file in
C:\Users\terry\TestRename\TestRename.ino
and successfully changed it to
C:\Users\terry\TestRenameChangedToThis\TestRenameChangedToThis.ino
But then I manually changed that to
C:\Users\terry\TestRename2\TestRename2.ino
I then opened it and tried changing it with Rename to TestRename2ToANewName
but that failed, with the error.
Tried that again, renaming to TestRename3, and that failed too.
Tried a minor edit to code and saved file before the attemp to rename, but that failed too.
Same with filenames as simple as A.ino. Only seem to succeed when renaming a new file for the first time.
EDIT: This may be relevant.
After spending couple of hours I have to drop it for now.
You can't change the main tab name (the left-most tab) in the tab rename dialog. That can only be done in Explorer or by doing a save-as of the sketch.