@@ -167,7 +167,6 @@ public Runner handleTweak(Sketch sketch,
167167 RunnerListener listener ,
168168 final boolean present ) throws SketchException {
169169 final JavaEditor editor = (JavaEditor )listener ;
170- boolean launchInteractive = false ;
171170
172171 if (isSketchModified (sketch )) {
173172 editor .deactivateRun ();
@@ -193,7 +192,7 @@ public Runner handleTweak(Sketch sketch,
193192 final SketchParser parser = new SketchParser (editor .baseCode , requiresTweak );
194193
195194 // add our code to the sketch
196- launchInteractive = editor .automateSketch (sketch , parser . allHandles );
195+ final boolean launchInteractive = editor .automateSketch (sketch , parser );
197196
198197 build = new JavaBuild (sketch );
199198 appletClassName = build .build (false );
@@ -204,8 +203,10 @@ public Runner handleTweak(Sketch sketch,
204203 public void run () {
205204 runtime .launch (present ); // this blocks until finished
206205 // next lines are executed when the sketch quits
207- editor .initEditorCode (parser .allHandles , false );
208- editor .stopInteractiveMode (parser .allHandles );
206+ if (launchInteractive ) {
207+ editor .initEditorCode (parser .allHandles , false );
208+ editor .stopInteractiveMode (parser .allHandles );
209+ }
209210 }
210211 }).start ();
211212
0 commit comments