@@ -517,7 +517,7 @@ protected void handleActivated(Editor whichEditor) {
517517
518518 // make this the next mode to be loaded
519519 nextMode = whichEditor .getMode ();
520- Preferences .set ("last.sketch. mode" , nextMode .getIdentifier ()); //$NON-NLS-1$
520+ Preferences .set ("mode.last " , nextMode .getIdentifier ()); //$NON-NLS-1$
521521 }
522522
523523
@@ -627,6 +627,12 @@ private void saveModeSettings(final File sketchProps, final Mode mode) {
627627 public Mode getDefaultMode () {
628628 return coreModes [0 ];
629629 }
630+
631+
632+ /** Used by ThinkDifferent so that it can have a Sketchbook menu. */
633+ public Mode getNextMode () {
634+ return nextMode ;
635+ }
630636
631637
632638 /**
@@ -976,12 +982,10 @@ public boolean handleClose(Editor editor, boolean modeSwitch) {
976982 // Since this wasn't an actual Quit event, call System.exit()
977983 System .exit (0 );
978984 }
979- } else {
985+ } else { // on OS X, update the default file menu
980986 editor .setVisible (false );
981987 editor .dispose ();
982- defaultFileMenu .insert (sketchbookMenu , 2 );
983- defaultFileMenu .insert (getRecentMenu (), 3 );
984- // defaultFileMenu.insert(defaultMode.getExamplesMenu(), 3);
988+ defaultFileMenu .insert (getRecentMenu (), 2 );
985989 activeEditor = null ;
986990 editors .remove (editor );
987991 }
@@ -991,16 +995,6 @@ public boolean handleClose(Editor editor, boolean modeSwitch) {
991995 // proceed with closing the current window.
992996 editor .setVisible (false );
993997 editor .dispose ();
994- // for (int i = 0; i < editorCount; i++) {
995- // if (editor == editors[i]) {
996- // for (int j = i; j < editorCount-1; j++) {
997- // editors[j] = editors[j+1];
998- // }
999- // editorCount--;
1000- // // Set to null so that garbage collection occurs
1001- // editors[editorCount] = null;
1002- // }
1003- // }
1004998 editors .remove (editor );
1005999 }
10061000 return true ;
@@ -1132,13 +1126,13 @@ public void populateSketchbookMenu(JMenu menu) {
11321126 }
11331127
11341128
1135- public JMenu getSketchbookMenu () {
1136- if (sketchbookMenu == null ) {
1137- sketchbookMenu = new JMenu (Language .text ("menu.file.sketchbook" ));
1138- rebuildSketchbookMenu ();
1139- }
1140- return sketchbookMenu ;
1141- }
1129+ // public JMenu getSketchbookMenu() {
1130+ // if (sketchbookMenu == null) {
1131+ // sketchbookMenu = new JMenu(Language.text("menu.file.sketchbook"));
1132+ // rebuildSketchbookMenu();
1133+ // }
1134+ // return sketchbookMenu;
1135+ // }
11421136
11431137
11441138// public JMenu getRecentMenu() {
0 commit comments