Skip to content

Commit 41f2816

Browse files
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 01906af commit 41f2816

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
@@ -369,11 +369,9 @@ protected void nameCode(String newName) {
369369
return;
370370
}
371371
sketch.addCode(code);
372+
editor.selectTab(editor.findTabIndex(code));
372373
}
373374

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

0 commit comments

Comments
 (0)