Open DaveTur opened 3 years ago
hi @DaveTur Since this has been here for a while (apologies for taking so long to get back to you), would you be able to test if this issue is still present in the latest Beta version? We fixed some tabs issues recently, would be nice if you could either confirm or deny the presence of this bug so we can move it into investigation or close it. Thanks ubi
I am still able to reproduce this bug using the latest build (2.0.0-rc6-snapshot-522a5c6)
I'm experiencing a similar problem: If I press "CTRL+S" the file is saved and immediately a dialog appears stating that the file has changed on disk. If I press "yes" the file in the editor and on the disk(!) are reverted to the original state. Toggling the auto save option doesn't seem to change the behaviour.
I'm using the current v2.0.3 - I can retry with the latest nightly build if you think the problem has been fixed.
Hi @Lorandil.
I can retry with the latest nightly build if you think the problem has been fixed.
Thanks for the offer, but that won't be necessary. I verified the bug still exists in the latest nightly. We will close this issue once the bug has been fixed.
For now, I'll share the workaround you can use to get a sketch back into a usable state after it has been affected by this bug:
Hi @per1234, thanks for the workaround. In the meantime I tried to rename my "Foo.h" to "foo.h" and changed the mixed includes of "Foo.h"/"foo.h" to be all "foo.h". That happens when you are using Windows ;) Let's see if that fixes the problem for me.
To make it short - streamlining the file names didn't help.
I used the workaround @per1234 mentioned and that fixed the issue for now.
This problem is marked as type imperfection but it is more serious than that. I have noticed several times that the IDE fails to build a project if you for example (in my case I decided to refactor and rename a class) I had been building with a class X10ex.cpp, X10ex.h and then refactored it to X10.cpp, X10.h using external tools \ file manager. Relaunching Arduino IDE it picks up the refactored files in the edit tabs... this is good... but when I do a build the compiler comes up with errors in the original X10ex.cpp file... this is bad! Relaunching IDE \ recompiling doesn't fix the fault.
These days I use Linux only, Ubuntu 22.04 LTS, and using Arduino IDE, the snap version. Version 2.3.2, Date 2024-02-20T09:54:08.669Z (4 months ago) CLI version 0.35.3.file:///media/main/SSD-480GB/IDEBuildBug.jpg When i was using Windows (this problem existed at least a year ago) I used to find the temp folder where the IDE was building from and delete the out of date files myself, but in Linux I haven't found where these are as yet.... (See my next comment for this)
In the attached screenshot, the file X10ex.cpp doesn't exist in my source folder... that error is referring to the old file name prior to refactoring.
I found the Arduino IDE temporary build folder... see attached screenshot for its contents. If I manually delete the offending files via a terminal command "rm X10ex.*" I can then successfully build the sketch using the Arduino IDE.
Describe the problem
Arduino IDE incorrectly displays redundant editor tabs after the user renames a secondary sketch file under the following conditions:
mv
)π The user will be confused by the presence of an editor tab for a file that no longer exists. They will not find any way to correct the situation via the Arduino IDE interface. π The bug can cause a loss of the user's sketch code.
To reproduce
Foo.ino
Foo.ino
in the sketch folder tofoo.ino
.// hello world
contents of the file have been replaced by the characters that were added to the "Foo.ino" editor tab.β
Auto save"Expected behavior
Editor tabs always reflect the actual sketch files.
Arduino IDE version
Original report
2.0.0-beta.10
Last verified with
69b7365
Operating system
Operating system version
Additional context
The bug does not apply to renaming using the editor tab control menu's "Rename" item because its dialog refuses to allow such a renaming (https://github.com/arduino/arduino-ide/issues/2272).
Additional Reports
Workaround
Issue checklist