First , Thanks to all for replying to my topic .
Sorry to hear that. Just commenting some lines will not cause these kind of issues. Try opening the ino file in a notepad an check again.
Always use Source control.
Yes . I then opened it in notepad . it was same and corrupted.
Sorry you lost work.
I use SyncBack for automatic backups daily X2.
One goes to my internal hard drive D and one to a table top network drive.
Once a week I run the program with an USB drive.
Then swapping this USB drive with a similar one that sits in a off site safety deposit box.
They have a free version:
Thanks , i will use it from now .
I don't use the IDE much - doesn't it have a ctrl-Z / undo?
Or is the undo depth limited?
Yes , i undo it , but it undoes for about 10 times , not more . the replacement was about 100 lines.
Sorry for your work lose..
I have a project that have more than 7000 lines of code, and I never have this kind of problem!
By the way, my entire project don't have all 7000 lines in one single ino file, I use about 32 separated files each one with your own functions!
Is your project had all the 6000 lines in one single file ?
Thanks , Yes . all the 6000 lines are in one single file ! ( also there are approximately 2000 lines in other files ... )
I'd wager that you fatfingered the find line?
Assuming ctrl+Z isn't able to save you, you're probably SOL.
I put everything I care about into a github repo, so as long as I remember to commit changes regularly, I don't have to worry about losing data, and can go back to an old version easily.
Re: multiple files - I thought there was some issue with the 1.6.6+ IDE and multiple files?
No, it was just replace "Serial.print" with "//Serial.print"
I use git and github. Using some sort of code repository system is just basic infrastructure for any working programmer. You need to learn to use git - you'll come to love it. It'd be nice if it were integrated into the IDE, but that's quite a bit of work.
My program is not open source and is not public usable ! I know that it was my fault , because i didnt make any backups from it , and its not what i usually do ...
Were you using code folding: folded code permanently disappears by search and replace action · Issue #4845 · arduino/Arduino · GitHub?
I use multiple files(tabs) on every project and can't think of any offhand.
+1 for using git or other version control program. It's a bit of work to learn but definitely worthwhile if you're writing a 6000 line program. I have found it actually makes me a better programmer to have to break my work into logical commits.
This is the point ! yes , i use code folding . and every functions that is corrupted was folded .
YES , something like this : folded code permanently disappears by search and replace action · Issue #4845 · arduino/Arduino · GitHub
Last night , i retyped all of my fuctions that was deleted . so my code is complete again.
Thanks to everyone,
and Sorry for my bad english ,