8

Undo is not working for me in ant editor in eclipse. When I press Ctrl-Z nothing happens.

Is it possible to enable undo somehow or is this a bug?

I am using Eclipse 3.4.2 (Ganymede) on Windows XP Professional.

Ludwig Weinzierl
  • 15,980
  • 10
  • 45
  • 49

3 Answers3

10

Yes undo should be working perfectly in an ant editor.
For Ctrl-Z to not workcould mean:

  • the shortcut has been assigned to another action (Windows > Preferences > General > Keys)
  • the undo buffer size is somehow at '0' (Windows > Preferences > General > Editors > Text Editor)
  • a plugin somehow 'steals' the key event for itself

Try a fresh install, and check also with a latest Galileo (3.5RC2) install to see if the problem persist.


Note: zvikico mentions the existence of a known bug with ant editor in 3.4.2

After a quick search, the following bugs might explain your situation:

  • 267780 [ant editor] delete line cannot be undone after cursor has been moved
  • 247434 Failed to undo removal of line in Ant editor, only with 'Eclipse IDE for Java Developers', with Eclipse Classic you don't get this behavior

and finally:

  • 239115 Undo functionality does not work anymore in the ant editor, mainly because a WTP issue, only solved in 3.5
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 6
    Don't bother checking the preferences. It is a known bug in 3.4.2. It is solved in 3.5. – zvikico May 27 '09 at 08:09
  • 1
    @zivkico: good point. I suppose you are referring to 239115, meaning undo does not work with ant editor only if you have WTP added to your eclipse3.4. I have updated my answer accordingly. – VonC May 27 '09 at 09:05
  • 2
    Thanks for your answers guys, the point about WTP made things really clear. It also explains why in some of my eclipse 3.4.2 installs the undo feature works. – Ludwig Weinzierl May 30 '09 at 08:39
2

I see this post is very old, but I am adding a response for the people who find this through the search engines.

Ctrl-Z stopped working in eclipse for me when I made a small change in one part of my code which in turn triggered an unexpected infinite loop in a different part of my code.

  • I used the windows task manager to kill the application that I had been testing when Ctrl-Z had stopped working, and then I used system.out.println() to identify the part of the code where the infinite loop was being triggered.
  • I then disabled that section of code, which in turn caused Ctrl-Z and everything else to start working again.
  • I was able to finish debugging from there.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
CodeMed
  • 9,527
  • 70
  • 212
  • 364
  • Interesting feedback, a practical example in addition to my original answer from almost 4 years ago. +1 – VonC Apr 01 '13 at 21:38
2

If the CTRL-Z (undo) does not work anymore, you might try that. It worked for me: go to Preferences -> General -> Keys and click on apply button or restore defaults button