IDE Undo fails most of the time

Archives Forums/BlitzMax Bug Reports/IDE Undo fails most of the time

Snixx(Posted 2009) [#1]
If you use the Undo feature it most of the time fails and ends up ruining your code with wrongly placed characters and linebreaks.

Simple feature that almost every app has and it fails in the MaxIDE...


Brucey(Posted 2009) [#2]
I wouldn't say "most of the time", but it does have issues.

The most likely time for something to go wrong is when you have a LOT of code in your file, and it is busy re-formatting the code and you are still typing or copy/pasting. Then it gets lost, and if you happen to hit Undo, it messes things up. At that point, you really don't want to type Undo or Redo again, because things will only get worse.

But generally, it's not really a problem. (Okay, the problem is still there, but you don't trigger it).


Mark Tiffany(Posted 2009) [#3]
I spent ages trying to tidy up the undo code for the CE version of the IDE. It's better, but not perfect. The best trick I found was to add small stubs of code to the IDE such that I could "simulate" keypresses via code, and I wrote a test harness using Brucey's rather nice BAH.MaxUnit module.

I then wrote a few obvious tests, and non-obvious ones, and specific ones for known issues, and fixed them. Then found some more issues, wrote a test harness and fixed them. Very easy to regression test I didn't break anything *and* to then run the whole set again on other platforms...which highlighted a few more issues to replicate in the harness, fix and test. Great stuff.

Seb, feel free to do same with the official IDE at some point if so inclined, noting that it the IDE would NOT gain a dependency on BAH.MaxUnit - it's only the test harness that references the module...


skidracer(Posted 2009) [#4]
Snixx, any chance you could switch to Community edition for a while and confirm the problems have been fixed. This is the first time I have ever heard of such a problem.

Brucey what do you mean by reformatting code? Can this feature be disabled?


Mark Tiffany(Posted 2009) [#5]
Skid, just for your comfort, at least some of the problems I fixed were of my own making with trying to get clever with formatting. I'm sure a few were pre-existing, or at least pre-existing ones exposed by me doing "clever" things elsewhere.

I'm also not going to claim CE version is perfect either! But it really would be worth taking a quick peek at what I did with MaxUnit on CE IDE for testing purposes - it's in the SVN - I even managed to do a bit of highlighter testing, albeit that side is rather hacky.


Snixx(Posted 2009) [#6]
Tested and it does not seem to be a problem with the CE version and I have never tried this before but I will be sticking with it as its a quite big improvement.