# Cursor sometimes moves to the next line on its own?

**URL:** <https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617>\
**Category:** IDE 2.x\
**Created:** [September 25, 2022, 7:38pm UTC](https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617 "2022-09-25T19:38:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bimetallic82](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@bimetallic82](https://forum.arduino.cc/u/bimetallic82)\
**Post date:** [September 25, 2022, 7:38pm UTC](https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617/1 "2022-09-25T19:38:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gaouser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gaouser/32/769504_2.png) [@gaouser](https://forum.arduino.cc/u/gaouser)\
**Post date:** [September 25, 2022, 8:11pm UTC](https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617/2 "2022-09-25T20:11:57Z")

</div>

you accidently press arrow keys on QWERTY or F keyboard

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [September 25, 2022, 8:18pm UTC](https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617/3 "2022-09-25T20:18:38Z")

</div>

Hi @bimetallic82 This bug is being tracked by the Arduino developers here:

> <https://github.com/arduino/arduino-ide/issues/437>
>
> \### 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
> 
> \### 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

There is no true fix at this time, but there is a simple workaround. I'll provide instructions:

1. Press the **Ctrl** + **Shift** + **P** keyboard shortcut ( **Command** + **Shift** + **P** for macOS users) to open the " **Command Palette**".
2. Select the "**Preferences: Open Settings (UI)**" command from the menu.
3. A " **Preferences**" tab will now open in the Arduino IDE. In the " **Search Settings**" field of that tab, type `editor.trimAutoWhitespace`
4. Uncheck the checkbox next to " **`☑` Remove trailing auto inserted whitespace.**"
5. 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.

---

<div class="post-metadata">

**Author:** ![bimetallic82](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@bimetallic82](https://forum.arduino.cc/u/bimetallic82)\
**Post date:** [September 25, 2022, 8:18pm UTC](https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617/4 "2022-09-25T20:18:50Z")

</div>

I don't think so. It happens while I'm typing so my hand is not near the arrow keys.

---

<div class="post-metadata">

**Author:** ![bimetallic82](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@bimetallic82](https://forum.arduino.cc/u/bimetallic82)\
**Post date:** [September 25, 2022, 8:19pm UTC](https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617/5 "2022-09-25T20:19:58Z")

</div>

Thanks very much.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [September 25, 2022, 8:20pm UTC](https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617/6 "2022-09-25T20:20:50Z")

</div>

You are welcome. I'm glad if I was able to be of assistance.

Regards,  
Per

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 24, 2023, 8:21pm UTC](https://forum.arduino.cc/t/cursor-sometimes-moves-to-the-next-line-on-its-own/1035617/7 "2023-03-24T20:21:46Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
