mirror of https://github.com/noisymime/Arduino.git
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 {
|
protected void addTab(SketchFile file, String contents) throws IOException {
|
||||||
EditorTab tab = new EditorTab(this, file, contents);
|
EditorTab tab = new EditorTab(this, file, contents);
|
||||||
tabs.add(tab);
|
tabs.add(tab);
|
||||||
|
reorderTabs();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeTab(SketchFile file) throws IOException {
|
protected void removeTab(SketchFile file) throws IOException {
|
||||||
|
|
|
@ -323,7 +323,6 @@ public class EditorHeader extends JComponent {
|
||||||
if (sketch != null) {
|
if (sketch != null) {
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
|
||||||
editor.reorderTabs();
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (EditorTab tab : editor.getTabs()) {
|
for (EditorTab tab : editor.getTabs()) {
|
||||||
SketchFile file = tab.getSketchFile();
|
SketchFile file = tab.getSketchFile();
|
||||||
|
|
Loading…
Reference in New Issue