Skip to content

Editor view for previous sketch not loaded after exit with non-sketch tab open #658

Closed
@per1234

Description

@per1234

Describe the bug

🐛 After doing a "File > Save As..." operation, the board selection changes back to whichever one happened to be selected when the sketch was opened.

To Reproduce

  1. Select File > New from the Arduino IDE menus.
  2. Select File > Save As... from the Arduino IDE menus.
  3. Save the sketch to some convenient location.
    🛈 The issue occurs when the previous sketch is opened after a restart, so a saved sketch is used in this demo since the File > New-generated sketch exists only in a temporary folder and thus is subject to cleanup by the OS after exit.
  4. Select File > Advanced > Keyboard Shortcuts from the Arduino IDE menus.
    The "Keyboard Shortcuts" tab opens.
  5. Select File > Quit from the Arduino IDE menus.
  6. Start the Arduino IDE

🐛 The sketch content is not shown in editor tabs as expected. Instead, there is only an empty space:

image

Expected behavior

Sketch files are always loaded in the IDE editor.

Desktop

Original

  • 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-9ecff86
    Date: 2022-02-15T15:53:31.454Z
    CLI Version: 0.21.0 [10107d24]

Additional context

The same occurs if the IDE is closed with "Preferences" tab open (the one accessed via the "Preferences: Open User Settings" command. This makes me suspect that any non-sketch tab will trigger this behavior.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions