@@ -424,10 +424,9 @@ public Base(String[] args) throws Exception {
424424 }
425425 }
426426
427- boolean showEditor = parser .isGuiMode ();
428427 if (!parser .isForceSavePrefs ())
429- PreferencesData .setDoSave (showEditor );
430- if (handleOpen (file , retrieveSketchLocation (".default" ), showEditor , false ) == null ) {
428+ PreferencesData .setDoSave (true );
429+ if (handleOpen (file , retrieveSketchLocation (".default" ), false ) == null ) {
431430 String mess = I18n .format (tr ("Failed to open sketch: \" {0}\" " ), path );
432431 // Open failure is fatal in upload/verify mode
433432 if (parser .isVerifyOrUploadMode ())
@@ -502,7 +501,7 @@ protected boolean restoreSketches() throws Exception {
502501 }
503502 int [] location = retrieveSketchLocation ("" + i );
504503 // If file did not exist, null will be returned for the Editor
505- if (handleOpen (new File (path ), location , nextEditorLocation (), true , false , false ) != null ) {
504+ if (handleOpen (new File (path ), location , nextEditorLocation (), false , false ) != null ) {
506505 opened ++;
507506 }
508507 }
@@ -794,14 +793,14 @@ public Editor handleOpen(File file) throws Exception {
794793 }
795794
796795 public Editor handleOpen (File file , boolean untitled ) throws Exception {
797- return handleOpen (file , nextEditorLocation (), true , untitled );
796+ return handleOpen (file , nextEditorLocation (), untitled );
798797 }
799798
800- protected Editor handleOpen (File file , int [] location , boolean showEditor , boolean untitled ) throws Exception {
801- return handleOpen (file , location , location , showEditor , true , untitled );
799+ protected Editor handleOpen (File file , int [] location , boolean untitled ) throws Exception {
800+ return handleOpen (file , location , location , true , untitled );
802801 }
803802
804- protected Editor handleOpen (File file , int [] storedLocation , int [] defaultLocation , boolean showEditor , boolean storeOpenedSketches , boolean untitled ) throws Exception {
803+ protected Editor handleOpen (File file , int [] storedLocation , int [] defaultLocation , boolean storeOpenedSketches , boolean untitled ) throws Exception {
805804 if (!file .exists ()) return null ;
806805
807806 // Cycle through open windows to make sure that it's not already open.
@@ -834,9 +833,7 @@ protected Editor handleOpen(File file, int[] storedLocation, int[] defaultLocati
834833
835834 // now that we're ready, show the window
836835 // (don't do earlier, cuz we might move it based on a window being closed)
837- if (showEditor ) {
838- SwingUtilities .invokeLater (() -> editor .setVisible (true ));
839- }
836+ SwingUtilities .invokeLater (() -> editor .setVisible (true ));
840837
841838 return editor ;
842839 }
0 commit comments