Sort of late, but here's an approach I call a "patch buffer". 
Basically, the idea is to accumulate edits as cheaply as possible using 
a sort of "patch," then perform them all when the cursor moves. 
One-character movement could be implemented by editing the patch, but 
that's more work...  There are almost certainly some off-by-one bugs 
lurking in it, but luckily the benchmark test doesn't mix operations 
very much.

Attachments:
http://www.ruby-forum.com/attachment/934/pb.rb

-- 
Posted via http://www.ruby-forum.com/.