(Windows 16, 64 bit)
I want to add a line between two lines of code. I position the cursor at the beginning (extreme left) of the line. I press enter , then up arrow then . brief pause The cursor repositions itself at the beginning of the new blank line. I press tab again and brief pause. Now the cursor is positioned at the beginning of the subsequent line.
Now, if I position the cursor at the beginning (extreme left) of the line. I press enter , then I can type the code I want but then must press home , then tab to get the code positioned where I want it.
(windows 10 64 bit)
Is this intentional? What is the thinking here? What do the almighty IDE designers expect one to do when a line is to be inserted?
OSD
weshowe
November 14, 2022, 2:08am
2
I have no idea what would be different, but I am running windows 10 here.
But I can position on a line start, press enter and then as many tabs as I want, my cursor just moves right two spaces per tab press. This sounds like what you expected to happen, and it does here.
I will watch this and see if someone smarter than I knows the answer.
Hi @OldSurferDude . This bug is being tracked by the Arduino IDE developers here:
opened 09:50AM - 06 Jul 21 UTC
closed 04:55PM - 28 Mar 23 UTC
conclusion: resolved
topic: code
type: imperfection
### Describe the problem
While editing, the cursor sometimes randomly jumps t… o the beginning of a new line
### To reproduce
1. Edit sketch
2. Usually when typing a new line, cursor will jump to beginning of next line
3. Seems to be related to auto-indent with tabs
### Expected behavior
The cursor should not jump around and stay where I am typing
### Arduino IDE version
2.0.0-beta.7
### Operating system
macOS
### Operating system version
Big Sur
### Additional context
#### Additional reports
- https://github.com/arduino/arduino-ide/issues/1669
- https://github.com/arduino/arduino-ide/issues/1534
- https://github.com/arduino/arduino-ide/issues/1364
- https://github.com/arduino/arduino-ide/issues/476
- https://github.com/arduino/arduino-ide/issues/810#issuecomment-1030400240
- https://forum.arduino.cc/t/cursor-jumping-problem/1023535
- https://forum.arduino.cc/t/ide-2-unwanted-cursor-movement/1060945
- https://forum.arduino.cc/t/arduino-ide-2-0-0-beta-12-weird-auto-newlines/920733
- https://forum.arduino.cc/t/misunderstood-ide-behaviour/1053246
- https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617
- https://forum.arduino.cc/t/cursor-jumps-to-left-of-page/1033841
- https://forum.arduino.cc/t/just-tried-ide2-for-first-time-tab-key-is-a-nightmare/990842
- https://forum.arduino.cc/t/editor-an-unsolvable-problem/989876
- https://forum.arduino.cc/t/autosave-messes-with-cursor-position/1046625
- https://forum.arduino.cc/t/random-line-returns/1081720
- https://forum.arduino.cc/t/arduino-ide-version-2-0-3-has-issues/1088682
- https://forum.arduino.cc/t/ide-2-editor-erratic/1088425
- https://forum.arduino.cc/t/odd-behavior-when-insert-line/1096241
- https://forum.arduino.cc/t/how-to-turn-off-the-auto-indent-feature/1096640
<a name="workaround"></a>
#### Workaround
1. Open the "**Command Palette**" via the <kbd>**Ctrl**</kbd>+<kbd>**Shift**</kbd>+<kbd>**P**</kbd> (<kbd>**Command**</kbd>+<kbd>**Shift**</kbd>+<kbd>**P**</kbd> for macOS users) keyboard shortcut.
1. Select the "**Preferences: Open Settings (UI)**" command.
1. A "**Preferences**" tab will now open in the Arduino IDE main panel. In the "**Search Settings**" field, type `editor.trimAutoWhitespace`
1. Uncheck the checkbox next to the "**`☑` Remove trailing auto inserted whitespace.**" setting.
1. Click the **X** icon on the "**Preferences**" tab.
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
I'll provide instructions for the simple workaround that was discovered by an Arduino forum member :
Open the "Command Palette " via the Ctrl +Shift +P (Command +Shift +P for macOS users) keyboard shortcut.
Select the "Preferences: Open Settings (UI) " command.
A "Preferences " tab will now open in the Arduino IDE main panel. In the "Search Settings " field, type editor.trimAutoWhitespace
Uncheck the checkbox next to "☑
Remove trailing auto inserted whitespace. "
Click the X icon on the "Preferences " tab.
Please let me know if you have any questions or problems while following those instructions.
Thanks for checking, Wes!
Are there options that we have set differently? eg. "editor quick suggestions" Mine is checked
ptillisch:
files.trimAutoWhitespace
Thanks! that seems to work, although the search was for trimAutoWhitespace not files .trimAutoWhitespace
Thanks again!
OSD
Thanks for pointing out that error! I apologize for any confusion my typo might have caused.
I meant to write editor.trimAutoWhitespace
(which is the full ID of the setting), but trimAutoWhitespace
alone will work just fine.
system
Closed
May 13, 2023, 3:13am
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.