mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
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)
This commit is contained in:
parent
5244daa5d1
commit
10dcc1d932
@ -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 {
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user