I'm using Arduino IDE version 2.0 on Windows 10. Sometimes the cursor moves on its own to the next line. It's happened about 50 times over the course of a week or so but it happens so fast I can't figure out the conditions which cause it to happen. Does anyone know what I'm talking about?
Hi @bimetallic82 This bug is being tracked by the Arduino developers here:
There is no true fix at this time, but there is a simple workaround. I'll provide instructions:
Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
Select the "Preferences: Open Settings (UI)" command from the menu.
A "Preferences" tab will now open in the Arduino IDE. In the "Search Settings" field of that tab, type editor.trimAutoWhitespace
Uncheck the checkbox next to "☑ Remove trailing auto inserted whitespace."
Click the X icon on the "Preferences" tab.
The reason this is considered a workaround rather than a true fix is that the "Remove trailing auto inserted whitespace" is generally a convenient feature. However, I think it is an effective workaround because you are trading the loss of a minor convenience feature in exchange for avoiding a bug that seriously harms the usability of the IDE. The Tools > Auto Format will take care of removing the trailing whitespace anyway.