They say that Serial Monitor is not a terminal program so they would like to keep it simple. So simple, so it is barely useful. And yeah, even its window can't be detached. But this is ok, most people just use terminal programs.
There are bugs in code analyzer: colorer can be messed up really easy, function folding often folds wrong code blocks. Clicking to "Go to the reference" often does nothing, but sometimes jumps to completely unrelated code.
Ctrl+T autoformats my code even without any notice! Silently. And sometimes I press it ( by mistake cause it is a "New Tab" in a browser) so my code silently gets messed up soooo bad. Good if I notice that and press Ctrl+Z. But often there are changes in the file outside of the current code block on my screen so I don't even know that code was "beautified"
Usually, the good practice, is to have a checkbox in the software setting: "confirm autoformat?". Every part of the software, where it tries to be "smart" must be optional: user must be able to switch any particular feature off/on;
As I said, it is often go unnoticed and then goes to github.
Example: I had a file, 30kb. Pressed Ctrl+T by mistake and didn't notice that, because autoformat changed my file at the very beginning while my editor was somewhere at the end of this file.
How I see that? At least show a fading window/message: "Autoformatted". Or show a text box: "Confirm autoformat? [Yes] [No] [x] Remember and don't ask it again".
Every time the software EDITS the code human writes - it must be acknowledged and must be optional.
But the IDE Auto format is not making changes to the code, just its layout. The functionality of the code will not change. If it worries you that much then why not configure the IDE to Auto format the code to the style that you want ?
I agree, this should be implemented soon because sometimes I need a taller window but as I grow serial monitor panel height the code window shrinks up to a few lines.
IMO autoformat won't "mess" anything, it "cleans things up" in a standardized way, so I can't get the reason for this complaint.
If the shortcut Ctrl-T is really making you mad, open menu File, Advanced, Keyboard shortcuts, then search for "arduino-auto-format" and assign it to a different shortcut (e.g. "Ctrl+Shift+T").
The proximity of these two statements might imply a correlation to some readers. Please note that this is not the case. The former is an intentional design decision, while the latter is a deficiency (arduino/arduino-ide#289) resulting from technical and resource limitations.
@vvb333007 created a dedicated topic for the discussion of this subject:
Please use that topic for further discussion of the subject.
@vvb333007 created a dedicated topic for the discussion of this subject:
Please use that topic for further discussion of the subject.
I remember you reported a bug like this previously:
However, the specific bug mentioned there was fixed. Are you still experiencing the problem?
Did you mean to say "Go to Definition"? I ask because Arduino IDE doesn't have a "Go to references" feature:
Are you able to reproduce the problem? If so, please provide detailed instructions I can follow to reproduce it on my computer.
As @docdoc mentioned, you can change the keyboard shortcut for auto format to something else. You can also remove it entirely.
I'll provide instructions for doing both of those things:
Change Shortcut
Select File > Advanced > Keyboard Shortcuts (or Arduino IDE > Advanced > Keyboard Shortcuts for macOS users) from the Arduino IDE menus.
The "Keyboard Shortcuts" tab will open in the Arduino IDE window.
Type arduino-auto-format in the "Search keybindings" field of the "Keyboard Shortcuts" tab.
Hover the mouse pointer over the "arduino-auto-format" row in the search results.
A pencil icon ("Edit Keybinding") will appear at the left side of the row.
Click the pencil icon.
The "Edit Keybinding for " dialog will open.
The input field in the dialog contains a text representation of the keyboard shortcut. Adjust this according to your preferences. β Notes about the syntax:
For most keys you can simply use the name of the key (i.e., a, 3, /, f2).
Special key names:
cmd - Command key on macOS.
ctrlcmd - Ctrl key on Linux/Windows, Command key on macOS.
Use the + separator for key combinations (e.g., ctrl+s).
Use a space separator for key sequences (AKA "chords") (e.g., ctrl+k ctrl+i).
Click the "OK" button in the dialog.
The dialog will close.
Click the X icon on the "Keyboard Shortcuts" tab.
Remove Shortcut
Note that you can still select Edit > Auto Format from the Arduino IDE menus when you want to format your sketch.
Unfortunately there isn't a way to disable keyboard shortcuts via the convenient keyboard shortcuts configuration GUI, but it can be done by manually adding a "removal rule" to the data file where Arduino IDE stores your custom keyboard shortcuts settings.
I'll provide instructions you can follow to do that:
Select File > Advanced > Keyboard Shortcuts (or Arduino IDE > Advanced > Keyboard Shortcuts for macOS users) from the Arduino IDE menus.
The "Keyboard Shortcuts" tab will open in the Arduino IDE window.
Click the { } icon at the right side of the tab bar.
A "keymaps.json" tab will open in a split editor panel.
If there is existing content in the "keymaps.json" tab, you must merge the above rule into the content.
Click the X icon on the "keymaps.json" tab.
If you get a save confirmation dialog, click the "SAVE" button.
Click the X icon on the "Keyboard Shortcuts" tab.
I found that the "Go to Symbol in Workspace..." command was also mapped to Ctrl/Command+T, so the above instructions disable the shortcut for that as well as "Auto Format".
No I wasn't, thanks. Btw even if screen is wider than it's tall, moving it to a side is just a workaround as it strictly depends on the width of the serial output lines (the window lacks an "auto-wrap" option, forcing us to "scroll" it horizontally on longer lines).
If in the future a new option "Floating" (like the browsers dev tools window, or F12) will be addded, it will be strongly appreciated.
Yes, sorry. Go To Definition.
Yeah I know I did report all these bugs already i was just giving examples.
As far as I can understand, the syntax colorer is of a very low priority for Arduino IDE team. If it is not true, then I can dig and report colorer glitches. I use GCC extensions here and there and this is where colorer often do weird things.
Thanks for Ctrl+T remapping idea!
Π‘ΠΏΠΎΠΉΠ»Π΅Ρ
As for the "Go To Definition" : it would be great if we can select directories (with source files) which IDE will use to build its search/reference/definitions database. So not only Libraries and sketch files are searched. For example, for ESP32 we can add the sources of ESP-IDF and FreeRTOS to the search database.