"Open Keyboard Shortcuts (JSON)" is path to broken split editor state #1850
Labels
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
Sketch tab management
The unit of the Arduino sketch project is a folder. Even though many of the common sketches consist of only a single file, the folder may contain multiple sketch code files. All the source files present in that folder are compiled to a single program.
In order to intuitively communicate the nature of the sketch to the user and avoid confusion that might be caused by code from files not visible to the user still being compiled, each Arduino IDE window contains a single sketch, with all primary code files of the sketch open as tabs. These tabs are not closeable as would be the case if Arduino IDE was a general purpose editor instead of a tool specifically designed for development of Arduino sketches.
Split editor feature
The Eclipse Theia IDE framework Arduino IDE is built on supports the "split editor" feature, where multiple panels can be created in the editor view so that content can be viewed side-by-side while editing. This includes having the same file open in two tabs.
Problems with split editor in Arduino IDE
Arduino IDE gained a split editor capability by chance rather than design through an update of the Theia dependency. The users discovered this new feature, but also discovered that it did not work correctly: the system for preventing primary sketch code file tabs from being closed did not allow the redundant tabs created by the split editor feature to be closed (#552). Since it did not work correctly and had not been planned, Arduino IDE project managers decided the split editor feature should be disabled (#940) until resources were available to implement it in a fully functional state (#909).
🐛 Despite the efforts to disable the feature, the editor is still split when the "Open Keyboard Shortcuts (JSON)" icon is clicked while using the "Keyboard Shortcuts" view. Once split, if the user creates or opens any sketch code file, it will not be possible to then unsplit the editor using the primary Arduino IDE interface.
To reproduce
SplitBugDemo
A keymaps.json tab opens in a split editor on the right side of the main panel.
An X icon will appear.
🙂 The tab closes, as is expected to be possible for supplemental files opened in the IDE's editor.
🙂 The editor is no longer split.
A keymaps.json tab opens in a split editor on the right side of the main panel.
😕 The context menu opens in an unexpected location.
The "Name for new file" dialog opens.
foo
in the field.🐛 The "foo.ino" editor tab was opened in the right split editor.
🐛 It is not possible.
🐛 An additional tab for the "SplitBugDemo.ino" editor tab was opened in the right split editor.
🐛 It is not possible.
Expected behavior
Opening primary sketch code files as tabs of a split editor panel is only possible once the split editor feature is in a fully functional state.
Arduino IDE version
692f29f
Operating system
Windows
Operating system version
11
Additional context
Since
keymaps.json
is a supplemental file and thus closeable, the IDE's behavior of opening this file in a split editor is not a problem in itself. It is actually a fairly reasonable default behavior since the user might like to view thekeymaps.json
editor alongside the "Keyboard Shortcuts" GUI view. But the average user is unlikely to openkeymaps.json
, so it wouldn't be a significant loss if the behavior was changed to opening the file without splitting the editor panel.Originally reported at https://forum.arduino.cc/t/cant-create-a-split-view-edited/1023920/17
Workaround
The IDE editor can be recovered from its split state by performing the following instructions:
Issue checklist
The text was updated successfully, but these errors were encountered: