From 4e84238527b945ed31fdd359dd7836610ccb6e75 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 27 Oct 2016 10:14:18 +0200 Subject: [PATCH] Restore "Delete" tab functionality The file was being deleted but the tab was still there --- app/src/processing/app/Editor.java | 5 +++++ app/src/processing/app/SketchController.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index ff245b931..a5f5dddf9 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1706,6 +1706,11 @@ public class Editor extends JFrame implements RunnerListener { tabs.add(tab); } + protected void removeTab(SketchFile file) throws IOException { + int index = findTabIndex(file); + tabs.remove(index); + } + // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . void handleFindReference(ActionEvent e) { diff --git a/app/src/processing/app/SketchController.java b/app/src/processing/app/SketchController.java index 1666e438d..086d4dae9 100644 --- a/app/src/processing/app/SketchController.java +++ b/app/src/processing/app/SketchController.java @@ -260,6 +260,8 @@ public class SketchController { return; } + editor.removeTab(current); + // just set current tab to the main tab editor.selectTab(0);