Skip to content

Commit 2fc0a2e

Browse files
committed
Merge pull request #3540 from aengelke/patch-1
Fix bug with tab sorting when adding new tabs
2 parents 0429ddd + dec20f4 commit 2fc0a2e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

app/src/processing/app/Sketch.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ protected void sortCode() {
270270
SketchCode temp = code[who];
271271
code[who] = code[i];
272272
code[i] = temp;
273+
274+
// We also need to update the current tab
275+
if (currentIndex == i) {
276+
currentIndex = who;
277+
} else if (currentIndex == who) {
278+
currentIndex = i;
279+
}
273280
}
274281
}
275282
}

0 commit comments

Comments
 (0)