1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

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

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();
}