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.
This commit is contained in:
Matthijs Kooijman 2015-12-17 11:47:14 +01:00 committed by Martino Facchin
parent fa82fe4db1
commit 8afeb501cb
1 changed files with 1 additions and 3 deletions

View File

@ -368,11 +368,9 @@ public class SketchController {
return;
}
sketch.addCode(code);
editor.selectTab(editor.findTabIndex(code));
}
// set the new guy as current
editor.selectTab(editor.findTabIndex(newName));
// update the tabs
editor.header.rebuild();
}