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.
(Obviously, it sounds very difficult to implement to me. But I’m just another user.)