Description
Describe the bug
Arduino sketches may consist of multiple files, which are shown in the Arduino IDE as tabs when that sketch is open. The file with name matching the sketch name is always leftmost in the tabs. Since the .ino
files are concatenated in order, the leftmost file is always the primary file.
For this reason, the leftmost tab should be selected by default.
🐛 However, the IDE currently selects the rightmost by default. This results in a less friendly experience for beginners.
To Reproduce
- Download this demonstration multi-file sketch: MultipleFiles.zip
- Unzip the downloaded file.
- Select File > Open from the Arduino IDE menus.
- Select the
MultipleFiles.ino
file from the unzipped sketch folder. - Click the Open button.
🐛 Note that the second tab (SomeTab.ino
) was selected.
Expected behavior
Select the leftmost tab by default.
On subsequent opens of the sketch, it is fine to remember the previous tab selection.
Desktop
- OS: Windows 10
- Version: 2.0.0-rc1-snapshot.f0d9894
Date: 2021-11-30T16:25:41.414Z
CLI Version: 0.20.1 [abb21449]
Additional context
Although the multi-file sketch capability is often used for more advanced sketches, this is not always true. For example, File > Examples > 02.Digital > ToneMelody is an introductory level example sketch.