We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › Auto-format deletes code
Page Index Toggle Pages: 1
Auto-format deletes code (Read 712 times)
Auto-format deletes code
May 26th, 2005, 6:27am
 
I have found what seems to be an error in the auto-format tool's behavior.  If I have code that looks like the following:

class Bug{
 Bug(){
   w = random(size)/3)+10;
   ...

and I run auto-format, it deletes everything in the sketch after the paren following the 3. Which seems very much the wrong thing to do.

I think it's because this code is wrong (extra paren; should be "random(size/3)+10"), so it's mis-parsing in some way.  If you hit "undo", you get a blank sketch (everything deleted); a second "undo" gets you back to where you were before you ran auto-format.

I'm running 0.90 on a win2k box, but I'm pretty sure it did the same thing on my linux box at work.
Re: Auto-format deletes code
Reply #1 - May 28th, 2005, 6:49pm
 
Yes, me too. I went from 6000 lines to 2000 lines. Frightening!


Re: Auto-format deletes code
Reply #2 - Jun 1st, 2005, 1:29am
 
in the meantime just undo (may need to more than once). the auto-format code is contributed from martin gomez so he's in charge of fixing it. but if he can't fix it then we'll just go back to the old formatter.
Re: Auto-format deletes code
Reply #3 - Jul 28th, 2005, 2:33pm
 
now filed in the bugs db:
http://dev.processing.org/bugs/show_bug.cgi?id=109
Page Index Toggle Pages: 1