Tuesday, October 23, 2012

Undo/redo philosophy

Last week i said i would make this post "soon", but then it slipped my mind. So, here it is.

I'm adding undo/redo to TypeR 1.1. That much is confirmed. What i want your feedback on is this: how often should i add to the revision list? I came up with a few options:
  • Every single modification is saved. This means every time you add or delete a letter, add, remove, or change a vowel, just everything. Most programs don't do that. However, it's the easiest to program, so that's what it is right now.
  • Saved every second. Every second, it saves the current revision. For obvious reasons, it would filter out revisions that are the same as the previous. If you made a small change, such as adding a letter, then deleted it before the second was over, it wouldn't be saved. This could be good or bad. But, if you pasted something, then accidentally undid (so now it's not saved), then you copied something else, it could be bad.
  • Every major change is saved. Every time there's a big change (such as 5 letters different, a paste, or clear), it gets saved. I don't really like this, because it means small changes aren't ever recorded.
  • All 3 combined! This is my favorite idea, so right now i'm planning on doing it like this. Let me explain how it works. It keeps a temporary list of every modification for each second. However, if there is a major change, saves how it was before the major change, the major change, then restarts the second. If the before and after are the same, but there are changes in the middle, it picks the largest change to save.
What do you think?
I'm waiting for a bit of feedback on this before reprogramming it.

No comments:

Post a Comment