Skip to content

Commit 10dcc1d

Browse files
committed
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)
1 parent 5244daa commit 10dcc1d

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

app/src/processing/app/Editor.java

+1
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,7 @@ public void reorderTabs() {
17111711
protected void addTab(SketchFile file, String contents) throws IOException {
17121712
EditorTab tab = new EditorTab(this, file, contents);
17131713
tabs.add(tab);
1714+
reorderTabs();
17141715
}
17151716

17161717
protected void removeTab(SketchFile file) throws IOException {

app/src/processing/app/EditorHeader.java

-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ public void rebuildMenu() {
323323
if (sketch != null) {
324324
menu.addSeparator();
325325

326-
editor.reorderTabs();
327326
int i = 0;
328327
for (EditorTab tab : editor.getTabs()) {
329328
SketchFile file = tab.getSketchFile();

0 commit comments

Comments
 (0)