Hi hjliang,

I reviewed the patch and found some issues. The most serious one is that you 
chose to implement the undo functionality on top of / separately from the sheet 
object (this is probably a good thing), but when implementing it, you touch the 
implementation details (such as spt_t members). It would thus not be possible 
to change the implementation of sheet without breaking the undo functionality - 
this is bad. You should not assume anything about the implementation of sheet 
(unless the undo would be part of sheet itself) and you can only use s-points, 
tags or coords (via their public API) for remembering positions in the file.

Also, I am not sure about the purpose of edit_sheet_{insert|delete}_listener(). 
It seems that you tried to replace some existing ad-hoc computations of redraw 
flags by a more systematic approach, but no lines doing that from the current 
code disappeared?

Another problem is that you push one element to the undo stack each time 
anything is inserted into the sheet - and this corresponds to one undo action. 
However, what happens if some user-level operation is broken down to multiple 
sheet-level operations? Then the user would be exposed to the 
implementation-specific steps that the editor took to perform the user-level 
operation (and would have to press Ctrl-Z to undo each of them), which is not 
something you want.

Cheers
-Jiri

hjliang wrote:
> Hi,
> 
> I have introduce undo/redo function to edit program.
> ctrl+z for undo and ctrl+y for redo.
> I have tested on qemu, and it seems work.
> Besides,I'm wondering how you test a program.Do you use a sophisticated 
> method?
> 
> 
> 

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to