We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8540b3 commit 950d88dCopy full SHA for 950d88d
app/src/processing/app/SketchController.java
@@ -253,13 +253,21 @@ public void handleDeleteCode() throws IOException {
253
sketch.delete();
254
editor.base.handleClose(editor);
255
} else {
256
+
257
+ boolean neverSavedTab = !current.fileExists();
258
259
// delete the file
- if (!current.delete(sketch.getBuildPath().toPath())) {
260
+ if (!current.delete(sketch.getBuildPath().toPath()) && !neverSavedTab) {
261
Base.showMessage(tr("Couldn't do it"),
262
I18n.format(tr("Could not delete \"{0}\"."), current.getFileName()));
263
return;
264
}
265
266
+ if (neverSavedTab) {
267
+ // remove the file from the sketch list
268
+ sketch.removeFile(current);
269
+ }
270
271
editor.removeTab(current);
272
273
// just set current tab to the main tab
0 commit comments