Location-specific Undo

This is more of a conceptual suggestion: As far as I can tell, right now Scrivener, like most word processors, has reverse-chronological undo only. Some have lists of changes you can undo, which would be nice. But what would be even more useful, it seems to me, would be to be able to point to a specific line and undo changes made to that line, regardless of when they were made. In other words, if you could make 8 changes throughout your MS, go back to the 5th one, point it, and hit undo. That way you could undo what you want without having to undo subsequent changes. Doubtless very difficult to implement.

Thanks for the program,
MM

I want this to exist.

So, let me play back what I’m hearing to see if I’m hearing it correctly. Folks would like to store every character ever typed into a Scrivener text file (the entire “undo stack”, as it is called in many editors) and be able to undo/redo it forever. This stuff about “by line” is actually probably not too hard since that would merely require some metadata about what line the entry came from.

Oh, but wait, when that line no longer exists? Ah, simple. Then the line and its metadata can be erased at that time, right?

Oh, no, wait. It might exist again, even if it had been deleted, because of the undoing of deletes. Lines have to be uniquely identified forever because a given line might come back into existence by being “undeleted.” And the relevant undo/redo information must still exist forever.

Oh, but wait, what’s a line, exactly? If I delete enough words, the lines wrap differently and what was line 1234 is now line 1232. How is that handled?

Oh, but wait, this is a many-to-many mapping of edits and “lines”. So many edits can refer to the same or different lines.

Oh, but wait, when is an edit to a line (whatever a line now means; it certainly doesn’t mean a line on the screen; that won’t work for anything but the simplest cases) no longer part of the same history? What happens when my edits totally replace a line or a set of lines with another line or set of lines? Do I keep the same history? Maybe I just reworded the entire passage and I want to remember the passage I am entirely replacing. But likewise, I might be editing to repurpose the article and keeping the same history makes no sense at all because this is now an article about French cheeses, not California wines.

Oh, but wait, maybe I’ve edited the end of text block A and the beginning of text block B. Is that edit now in the edit history of both text block A and text block B? Or is it in the edit history of a new text block C that overlaps both A and B?

Oh, but wait, what about an edit that only overlaps one or the other, then there is an edit that overlaps both. How is the undo history maintained in that case?

Oh, but wait, how do I even determine when “the same block of text” is really “the same block of text?”

Should be easy. :smiley: (Obviously, it sounds very difficult to implement to me. But I’m just another user.)

@jravan,

You forgot that I’ve just opened the second editor pane and had to adjust the width of the editor I’m working in, so what was on line 1234 is now on line 1632 … or is it? 'Cos what is a ‘line’ anyway in Scrivener, since text is a long string of symbols soft-wrapped at a given point because of the column width that happens to be operative at the moment?
:laughing:
Mark

Try snapshots. :slight_smile: Not in a predictive fashion, but to use as an extended “undo pin”. Like setting a milestone. Take a snapshot when you identify something twenty edits back that should be the way it was. Now with the current state saved as a snapshot, hit undo until you reach the spot you wish to restore. Copy it, roll back to the current version, and paste in the old text where it should go. Discard the Snapshot if you want, but that might be a good place to set it anyway, since it represents a spot in the chronology of this document where you changed your mind. Now you have both the part you erased before, restored, and the part you erased over it, saved into that snapshot. Best of both worlds.

Thanks for tip, AmberV.

Like I say, I primarily meant the suggestion to be of use conceptually, as one more area in which Scrivener can address writers’ needs in a way no one else is doing.

It may be outside current technological limits. However, it’s not hard to conceive how it might work. If Scrivener took a snapshot every thirty seconds, say – again, quite possibly outside current storage limits, but who knows what will happen in the future? – then you could point at some text and click, the program could take five (or whatever) words on either side of the click, and search for the last snapshot where anything within that string was different than it is now. The data load might be huge, but the concept itself seems surmountable.

MM

Martin, now it’s sounding similar to the new feature coming in OS X Lion, “Versions.” So just wait a few more days and maybe Apple will have given us a OS blanketed ability to do something like this.

Also, I found something really cool that Scrivener does the other day, that’s sort of relevant. I’m not sure how exactly it works, but I found that when I had the main window split horizontally, and I had two different documents open, I could use undo in them independently of each other. So, while it wasn’t line-specific, it was section-specific. I know they are technically different documents (perhaps that’s why it works), but in word, this would be one gigantic document, and that would not be possible.

So, that’s pretty neat.

I cannot comment fully on “Versions” seeing as it’s all under NDA, but I can say that “Versions” are something completely different, and Scrivener won’t support that Lion feature because it’s not currently compatible with Scrivener’s file format. Scrivener’s current Snapshots feature, though, is pretty much an in-project “Versions”.

All the best,
Keith