When I used 2007 and saw this, it only happened on very long units (10,000+ lines - having that many is an issue for another discussion :p) Usually the IDE would be fine, then typing would become fairly slow - I could see the letters I typed lagging behind in the code editor. Unless I paused and let the editor catch up, I'd get that error.
So, my fix was:
- If you're in a large unit and the editor starts lagging, pause, immediately. Let it catch up, and keep going.
This is really annoying, but worked for me.
I also turned off many of the Code Insight features, but I don't know if they affected this particular issue or not. They did help general editing speed. Turning them off was recommended to me in the then-Codegear forums. I can't remember who by, but I have a vague feeling it may even have been one of the Codegear QA staff who was aware of the bug but was trying to see if I could narrow down what affected or caused it. This was a couple of years ago now though, so don't take that as gospel.
Splitting your files into smaller, say <5000 line units may also help. For me it only happened on large and complex files.
The issue seems to have been fixed in RAD Studio 2010. Another way to avoid the error would be to upgrade :) If you do, wait a few days or talk to their salespeople first. The next version, RAD Studio XE, is due out at any moment. I'd recommend upgrading anyway: you'll need to handle Unicode issues, but other than that the 2010 edition is the best version I've used, including its stability, and I've used Delphi since version 1.