From 10dcc1d932664abc8d110a5c49bc875f19a08f69 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 7 Nov 2016 12:25:53 +0100 Subject: [PATCH] When a new tab is created is also selected Previously it was selected always the last tab because the action sequence was: - create the new tab (in the last position) - select the new tab index (last) - sort the tabs (the new tab is now in the middle but the selected is always the last) instead the correct action sequence is - create the new tab (in the last position) - sort the tabs (now the new tab is in the middle) - select the new tab index (now the correct index is selected) --- app/src/processing/app/Editor.java | 1 + app/src/processing/app/EditorHeader.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 814a3286b..ec9cf3068 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1711,6 +1711,7 @@ public class Editor extends JFrame implements RunnerListener { protected void addTab(SketchFile file, String contents) throws IOException { EditorTab tab = new EditorTab(this, file, contents); tabs.add(tab); + reorderTabs(); } protected void removeTab(SketchFile file) throws IOException { diff --git a/app/src/processing/app/EditorHeader.java b/app/src/processing/app/EditorHeader.java index 83353559c..42d6769f8 100644 --- a/app/src/processing/app/EditorHeader.java +++ b/app/src/processing/app/EditorHeader.java @@ -323,7 +323,6 @@ public class EditorHeader extends JComponent { if (sketch != null) { menu.addSeparator(); - editor.reorderTabs(); int i = 0; for (EditorTab tab : editor.getTabs()) { SketchFile file = tab.getSketchFile();