Alexander Klenin wrote:
> On 10/27/07, Simon Large <simon.tortoisesvn@googlemail.com> wrote:
>
>> If you paste several characters into a line, it takes multiple Ctrl-Zs
>> to remove them again. In most editors Ctrl-Z works on the operation,
>> not the individual characters. If you paste a block of 50 lines, that
>> makes it extremely slow to undo.
>
> Fixed in revision 11147.
> The problem was not a bug, but rather a case of missing functionality.
> First I tried to fix it by 'bundling' all the changes into a single
> 'viewstate' struct.
> However, it turned out that CUndo::Undo could actually correctly undo
> only a limited subset of possible viewstates, due to the ambiguous ordering
> of different kinds of operations. So I implemented a separate 'grouping'.
> I also has suspicions that pasting a large blocks of
> text might be rather wasteful of memory -- creating three viewstate
> structs for every character.
>
> So, I wonder -- would not it be a better design to create
> 'CEditAction' base class
> with 'CChangeLine', 'CInsertLine', 'CRemoveLine', etc. as descendants,
> each with its own implementation of 'Undo' virtual method?
> Also, why are three viewstates per action needed -- AFAICT each of
> them is always
> either empty or duplicates the other two?
It was even worse before I refactored the undo code to use viewstates.
Multiple vectors each holding a separate undo state.
Just go ahead and change the code as you like - if it works nobody will
complain.
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Sun Oct 28 09:22:08 2007