mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-26 20:54:22 +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:
parent
fa82fe4db1
commit
8afeb501cb
@ -368,11 +368,9 @@ public class SketchController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sketch.addCode(code);
|
sketch.addCode(code);
|
||||||
|
editor.selectTab(editor.findTabIndex(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the new guy as current
|
|
||||||
editor.selectTab(editor.findTabIndex(newName));
|
|
||||||
|
|
||||||
// update the tabs
|
// update the tabs
|
||||||
editor.header.rebuild();
|
editor.header.rebuild();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user