From: Eric Mahurin Date: 2007-11-09T05:35:40+09:00 Subject: Re: Editing Text (#145) ------=_Part_45994_29150410.1194554137878 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 11/8/07, Sean Surname wrote: > > 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. > If you start mixing edits and movements, I don't think the performance will be very good because a fixup is O(n) after some edits. Consider a sequence of n (insert_before;left). Each left will do a full fixup making this sequence O(n**2). Eric ------=_Part_45994_29150410.1194554137878--