Skip to content

Commit 8afeb50

Browse files
matthijskooijmanfacchinm
authored andcommitted
In SketchController.nameCode, only switch tabs when adding file
When renaming a file, the current tab is already the correct one, so no need to switch. This allows looking up the tab index based on the SketchCode object, instead of doing a filename lookup.
1 parent fa82fe4 commit 8afeb50

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/src/processing/app/SketchController.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,9 @@ protected void nameCode(String newName) {
368368
return;
369369
}
370370
sketch.addCode(code);
371+
editor.selectTab(editor.findTabIndex(code));
371372
}
372373

373-
// set the new guy as current
374-
editor.selectTab(editor.findTabIndex(newName));
375-
376374
// update the tabs
377375
editor.header.rebuild();
378376
}

0 commit comments

Comments
 (0)