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

Restore "Delete" tab functionality

The file was being deleted but the tab was still there
This commit is contained in:
Martino Facchin 2016-10-27 10:14:18 +02:00
parent 12eb09f0b9
commit 4e84238527
2 changed files with 7 additions and 0 deletions

View File

@ -1706,6 +1706,11 @@ public class Editor extends JFrame implements RunnerListener {
tabs.add(tab); tabs.add(tab);
} }
protected void removeTab(SketchFile file) throws IOException {
int index = findTabIndex(file);
tabs.remove(index);
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
void handleFindReference(ActionEvent e) { void handleFindReference(ActionEvent e) {

View File

@ -260,6 +260,8 @@ public class SketchController {
return; return;
} }
editor.removeTab(current);
// just set current tab to the main tab // just set current tab to the main tab
editor.selectTab(0); editor.selectTab(0);