Undo undoes the unexpected (or when in Rome...)

If I make a change in Method_A, then make a change in Method_B, then return to Method_A to undo its last change, the change in Method_B gets undone instead. There is no visual cue that a change was made in Method_B. This is bad, or at least being unaware of this is bad.

In a word processing document, making a change at the top, scrolling to the bottom and making a change, then scrolling back to the top and performing an undo is expected to undo the change at the bottom and the changed section scrolls back into view to confirm the change.

Of course, when working between two word processing documents the undo is always performed in the document being edited.

So, is Xojo to be thought of as editing one long source code document, or as editing a series of documents that get assembled into the source code? (either way, a visual of the undo would be extremely helpful)

Xojo 2024 4.2, macOS 15.3.1 - tested with button Pressed methods

What code is in Method_A, what code in in Method_B?

What code do you have in button Pressed Event?

Have you had a chance to work through this Introduction to Xojo Programming Textbook
Introduction to Xojo Programming Textbook

Hope you find it helpful :grinning:

The Intro PDFs are a great start, but I cannot find where they address the use of Undo in the IDE.

Any characters in the methods are affected by this. It’s easiest to just test with comments since it’s more of an Editor, rather than a syntax, issue.

What you describe is an issue I stumble upon from time to time too.
Yes, you can consider a Xojo document one big file (which physically might be split into parts like when using the project format), and IMHO editor should indeed jump back to an undoed piece of code but seldom does.
Years ago there were plans for an IDE update. Maybe when this is done (if it’s still planned), undo will be fixed too.

1 Like

Unfortunately, the behavior you describe is completely normal for the Xojo IDE. Even under Windows.

And it’s not limited to certain areas. Change code wherever you want, but when you undo those changes you can’t rely on the IDE to show you what you just undid. Sometimes it works, sometimes it doesn’t… :person_shrugging:

Yes, this is very irritating and it would be nice to have it such that when something is undone, that is shown.

@Keith_Culotta
oh ok now I understand :grin:
Sorry for the confusion