保存是否应该清除撤消/重做堆栈?
当用户在应用程序中保存更改时,是否应该清除撤消/重做堆栈?能够撤销到保存前的状态会不会异常?
When the user saves changes in an application, should the undo/redo stacks be cleared? Would it be abnormal to be able to undo to a state before a save?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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.
我想说这两个问题的答案是否定的。
(例如,如果您更改某些内容并保存它,然后发现它会导致不需要的行为,该怎么办?通过撤消对先前状态的更改来取消提交该保存是有意义的,从而允许您保存它们。)
I would say the answer to both of these questions is no.
(For instance, what if you change something, save it, and then discover it leads to unwanted behaviour? It makes sense to be able to uncommit that save by undoing your changes to the previous state, allowing you to save them.)
就我个人而言,我不喜欢保存后清除撤消堆栈。编程时,我经常按 Ctrl-S(每个人都知道保存的重要性:-)),同时我希望能够撤消一些最近的更改。
在我看来,保存后无法撤消是一个令人不快的意外。通过应用(对用户而言)最少意外的规则,您应该保留撤消历史记录。
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.