Weird UNDO issue with Arduino IDE 1.9.0

Hello Not sure if this is the correct forum for this...

I had to 'upgrade' to 1.9.0 to get a particular library to work (can't remember which one)

I have noticed a maddening UNDO issue. Wondered if anyone else has encountered it?

If I press CTRL+Z to undo - it resets the code back to its original form. Deleting ALL of your new code you added since you loaded it.

It's totally maddening.

Several times yesterday I wrote a whole pile of code. Ran it, and realised I needed to step back one place and BOOM.... all gone. And it's not there anywhere all to retrieve.

The only way around it, is to save it as another file name every few minutes.

I thought it might be my laptop, but CTRL+Z works fine in all the other programs.

Hmm

Here's what I experience: Undo undoes all changes made since the last cursor movement (other than the cursor movements that are caused by adding or removing text). The cursor movement can be done via the keyboard's arrow keys or the mouse. Each of these cursor movements creates an undo history point. Is that the same behavior you're reporting?

This Undo behavior was introduced in Arduino IDE 1.6.5. With previous IDE versions, an undo history point was created on every text addition or removal.

I notice that Notepad++ and Firefox work the same way. Chrome works similarly, but it creates an Undo point on the first text addition after pressing Enter.

No

Say I write a few routines, then edit some variables. Add a few lines, comments some lines etc Uploads performed between these changes. Maybe 30 mins work.

Oh, that last change didn't work. CTRL+Z.

Back to the original sketch that I started with. All text I have added over the last 30 mins gone, never to be seen again.

Doesn't do it in earlier versions of the IDE

SteveRC2017: No

Say I write a few routines, then edit some variables. Add a few lines, comments some lines etc Uploads performed between these changes. Maybe 30 mins work.

You didn't really answer my question. If you are not moving the cursor using the arrow keys or mouse during that 30 minutes, then that's exactly the behavior I observe.

Please try this:

  • Type some text.
  • Press Enter
  • Press the up arrow key.
  • Type some more text.
  • Ctrl+Z

Did all the text you typed disappear, or only the text you typed before pressing the up arrow key? For me, it is the latter.

SteveRC2017: All text I have added over the last 30 mins gone, never to be seen again.

Are you saying that Redo doesn't work?

SteveRC2017: Doesn't do it in earlier versions of the IDE

Which versions?

Which operating system are you using?

Using your example... all the text disappears. In fact, its all the text since you opened the sketch. Even after multiple 'pressing enter', moving, etc.

Redo and Undo are unavailable. There is nothing to 'redo' or 'undo'.

Tried version 1.5.7 and 1.8.7 - they work correctly (on the same laptop). Running Windows 10.

I have various versions of the IDE on different laptops, as I have some older projects that will not compile or operate correctly using the newer IDE's.

For example, I have a 2.4" tft touchscreen that only works if you use 1.5.7. Any newer version corrupts/knackers the touchscreen co-ords for some reason (that took many evenings to figure out).

That is strange. I am also using Windows 10, so this isn't a universal problem. Which build of the Arduino IDE beta are you using? I'm using the latest: 116.

I am also always able to Redo my Undos.

It definitely sounds like a bug, especially the part about not being able to Redo. If you can confirm that it occurs with the latest beta build, it would be good to submit a bug report. It would be most helpful if you check whether it also occurs with the hourly build, 1.8.10, and back until you find the IDE version where the bug was introduced.

You can submit bugs about the Arduino IDE here: https://github.com/arduino/Arduino/issues

I will investigate further tomorrow. Too damn cold to venture out to the garage/workshop now!

It is an odd one

How do I find out the version…

In ‘about’ it just says 1.9.0 beta