1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Saving immediately when replacing a sketch with another in the same editor. Should fix bug: http://code.google.com/p/arduino/issues/detail?id=88

This commit is contained in:
David A. Mellis 2009-12-26 15:42:30 +00:00
parent def86681b7
commit 9a5507fd07

View File

@ -584,7 +584,7 @@ public class Base {
* Replace the sketch in the current window with a new untitled document. * Replace the sketch in the current window with a new untitled document.
*/ */
public void handleNewReplace() { public void handleNewReplace() {
if (!activeEditor.checkModified(false)) { if (!activeEditor.checkModified(true)) {
return; // sketch was modified, and user canceled return; // sketch was modified, and user canceled
} }
// Close the running window, avoid window boogers with multiple sketches // Close the running window, avoid window boogers with multiple sketches
@ -616,7 +616,7 @@ public class Base {
* @param path Location of the primary pde file for the sketch. * @param path Location of the primary pde file for the sketch.
*/ */
public void handleOpenReplace(String path) { public void handleOpenReplace(String path) {
if (!activeEditor.checkModified(false)) { if (!activeEditor.checkModified(true)) {
return; // sketch was modified, and user canceled return; // sketch was modified, and user canceled
} }
// Close the running window, avoid window boogers with multiple sketches // Close the running window, avoid window boogers with multiple sketches