Skip to content

Rightmost tab is selected by default #643

Closed
@per1234

Description

@per1234

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

  1. Download this demonstration multi-file sketch: MultipleFiles.zip
  2. Unzip the downloaded file.
  3. Select File > Open from the Arduino IDE menus.
  4. Select the MultipleFiles.ino file from the unzipped sketch folder.
  5. 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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions