Skip to content

Selecting sketch file with double-click results in duplicate tabs #656

@per1234

Description

@per1234

Describe the bug

Arduino sketches may consist of multiple files, which are shown in the Arduino IDE as tabs. The "Search" and "Sketchbook" side bar panels allow the selection of the active tab by clicking on its sketch file.

When this selection is done under the following conditions:

  • The tab has not been selected since the sketch was opened
  • The selection is done via a double-click rather than a single click

🐛 Instead of selecting the tab as expected, a duplicate tab is opened.

To Reproduce

  1. Open a multiple file sketch in the Arduino IDE.
    The following sketch is provided for the demonstration: MultipleFiles.zip
  2. Open the "Search" side bar panel by clicking the magnifying glass icon.
  3. Search for the text hello
    There will be a search result in each of the files of the demo sketch.
  4. Double click on a search from either of the tabs other than the one that is currently selected in the editor.
    For example, if the "SomeTab2.ino" tab is selected, then double-click the search result in the "MultipleFiles.ino" or "SomeTab2.ino" tabs.

🐛 There are now two tabs for the file associated with the search result you clicked:

image

Expected behavior

Clicking a file of a currently open sketch in a sidebar panel always selects its tab.

Each sketch file only ever gets a single tab in the editor.

Desktop

Original report

  • OS: Windows 10
  • Version: 2.0.0-rc1-snapshot.f0d9894
    Date: 2021-11-30T16:25:41.414Z
    CLI Version: 0.20.1 [abb21449]

Last checked with

  • OS: Windows 10
  • Version: 2.0.0-rc3-snapshot-2f9bf86
    Date: 2022-02-11T14:52:06.341Z
    CLI Version: 0.21.0 [10107d24]

Additional context

🐛 The equivalent procedure will also produce duplicate tabs when using the "Sketchbook" side bar panel.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions