Bug 1456 : IDE new button prompts for save without actually saving anything.
Last modified: 2010-02-04 12:25




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
Lonnen
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2010-02-04 08:09
When there are unsaved changes to a sketch and the 'new' button is pressed
in the IDE the IDE prompts you asking if you want to save changes. If you
select 'yes' the sketch closes and a new sketch opens. If you later re-open
the original sketch you see that none of the changes were saved.

This is occurring on a Processing 1.0.9 on MacBook revision(5,1) running
10.6.2.

Tested using:
void setup(){
stroke(122,122,122);
}

void draw(){
background(0);
line(width,height,mouseX,mouseY);
}
Additional Comment #1 From Lonnen 2010-02-04 09:22
This also occurs when you open a sketch from file-> sketchbook and are
prompted to save changes. I've confirmed that it is present in the latest
test build as of this post, revision 6072.

Curiously, closing sketches save correctly via the prompt.

As a work around handleNew() and handleOpen() could be used instead of
handleNewReplace() and handleOpenReplace().
Additional Comment #2 From Lonnen 2010-02-04 09:36
Got it!

In Editor.java I was looking at checkModified(boolean immediately) and the
docstring (Line 1749) says: * not happen asynchronously. Come to think
of it, that's always now?

Sure enough, if I add immediately = true; as the first line of it, this
bug goes away. Should the function be rewritten to always act as if this
were the case? The checkModified() calls in base.java would need to be
modified to not send a boolean.

If this is the case, how would I submit the changes? Zip the .java files
and attach to this ticket?



Additional Comment #3 From fry 2010-02-04 09:48
Thanks for looking into it. For this one I can probably just make the
(single line or two) change from your description, though normally I'd just
ask for modified .java files zipped and attached like you say. I'm working
on a new release sometime today or tomorrow and can get the fix in, so let
me know if you find anything else in the meantime.
Additional Comment #4 From fry 2010-02-04 12:23
Fixed for whatever comes after 1.0.9.

Thanks so much for looking into it, it's a huge help.
Additional Comment #5 From fry 2010-02-04 12:25
*** Bug 1418 has been marked as a duplicate of this bug. ***