当用户在应用程序中保存更改时,是否应该清除撤消/重做堆栈?能够在保存前撤消到某个状态会不会很不正常?
4 回答
That would be a bad idea, especially for people (like me) who often instinctively save. Also, there is no logical reason why undo/redo information should be deleted when saving (and any data gained from the user is precious).
It is common practice, however, not to include undo/redo information in the saved file.
Personally I don't like when the undo stack is cleared after a save. When programming I hit Ctrl-S very often (everybody knows the importance of saving:-)) and at the same time I want to be able to undo some of the recent changes.
In my opinion it is an unpleasant surprise not to be able to undo after a save. And by applying a rule of the least surpirse (to the user) you should keep the undo history.
I can't think of an app where save clears the undo/redo stack. I don't see a good reason to do that; it gains nothing for you, but the user loses something.
我会说这两个问题的答案是否定的。
(例如,如果您更改某些内容,保存它,然后发现它会导致不需要的行为怎么办?通过撤消对先前状态的更改来取消提交该保存是有意义的,允许您保存它们。)