In lieu of "track changes"...

I don’t want to spend too many words on this as I’m already behind on 1.04 and the new seed of Leopard is waylaying me big time, but…

Okay, consider these short texts:

[code]This is the first paragraph.

This is the second paragraph.[/code]

[code]This is the amazing paragraph that comes first.

This is an inserted paragraph.

This is the revised second paragraph.[/code]

Now, were would Scrivener begin comparing these? Let’s go paragraph by paragraph, as you suggest:

1st paragraph:

“This is the first paragraph.” vs “This is the amazing paragraph that comes first.”

Okay, everything is fine right up to "This is the the ". Presumably, Scrivener would have to go through character-by-character. Or would it go word-by-word? Then what? Okay, the next characters are different. We have “paragraph” and “first” in this paragraph again, but they are in a different order, and there are some insertions. How does Scrivener work out exactly what is different? You can say, "Well, it just looks at the words and can see that it maybe needs to highlight “amazing paragraph that comes”. Easy to say, but how to do it in code? Not so easy at all. (It is always very easy to say, “I don’t think it would be very hard…” if you’re not the one who has to code it. :slight_smile: )

Well, maybe we just take a paragraph-by-paragraph comparison, like you say, and mark everything as different in the paragraph from the first character that is different in the comparison. That would be fairly straightforward (for the first paragraph if no paragraphs have been inserted - see below). The following words in our example text would be marked as changed in this case: “amazing paragraph that comes first”. But then consider these two paragraphs:

To be, that is the question, whether it is nobler in the mind to suffer the slings and arrows of outrageous fortune or to take arms against a sea of troubles and by opposing end them.
To be or not to be, that is the question, whether it is nobler in the mind to suffer the slings and arrows of outrageous fortune or to take arms against a sea of troubles and by opposing end them.

Hmm, now our up-to-the-first change approach falls down, because only the first two words of the paragraph will be noted as unchanged: " or not to be, that is the question, whether it is nobler in the mind to suffer the slings and arrows of outrageous fortune or to take arms against a sea of troubles and by opposing end them" will all be marked as unchanged.

Again, I ask: upon encountering a character that is different in each paragraph, how does Scrivener then decide where the text resumes unchanged? Firstly it would need to look at the next letter of the original file, and then it would parse forward to the next occurrence of that letter in the newer version. Then it would check the next letter of the original file, and check to see if the next letter in the newer version is the same. If not, it will have to start looking for the first changed letter again and start again. If it is the same, it will have to check the next letter. But how many letters does it take before Scrivener can say that they match? Consider these two sentences:

The hairy fox liked to play dice.
The hair of the fox-trotting lady looked like it had been plastered to her dirty forehead with cement.

Potentially, in the second version - which is clearly not even linked to the first sentence in any way - it could get marked thus (bold indicating changes, non-bold indicating text that is unchanged):

The hair[b] of the[/b] fox[b]-trotting lady looked[/b] like[b] it had been plastered[/b] to [b]her [/b]di[b]rty forehead with [/b]ce[b]ment.[/b]

Now let’s go back to our original example. In the original example, the first paragraph was straightforward (well, it should have been, but we have already seen that it was, in fact, not). Now we come to the second paragraph - but wait! In the second text, a paragraph has been inserted. So the last part of the original text reads:

This is the second paragraph.

And the last part of the new version reads:

[code]This an inserted paragraph.

This is the revised second paragraph.[/code]

What happens when Scrivener comes to compare the second paragraph? Well, the inserted paragraph and the original paragraph start the same: "This is " - so Scrivener could easily mistake this and think they were the same paragraph. Which means that two words isn’t enough to decide that two paragraphs are the same. (But if that was the case, when comparing “There is one and only one way to do this” and “There is only one way to do this”, Scrivener would fail to realise that the first two words are in fact unchanged!)

So, how does Scrivener decide that a paragraph is an inserted paragraph and not just a heavily edited original paragraph? Well, you might answer, Scrivener could parse forward to the next paragraph and see which is the best fit. But what if the next paragraph is the original paragraph but has been edited so heavily that Scrivener cannot recognise it?

And this is just the parsing code. You are also suggesting that Scrivener should have a split view, note attachments and all sorts. Essentially, what you are asking for is a month or two’s worth of development on a feature that is not integral to Scrivener and not central to my original vision of Scrivener. There is a good reason I went to the length of calling the feature “Snapshots” and not “Versions”. :slight_smile:

So, the answer to this is very positively a negative: there will be no version comparison in an 1.x release of Scrivener. After 1.04, in fact, new features will not be added anywhere nearly as often - after 1.04, it is going to be mainly bug fixes. I have been saying that since 1.0 (and it’s in the readme and on the website!) but this time, honest guv’, I’m going to get back to my writing with Scrivener. 1.04 is already becoming a horrible chore… :frowning:

Thanks for taking the time to post suggestions,

All the best,
Keith

P.S. AmberV, if you come across this, could you link to this thread in the FAQ? This question is asked occasionally, and this is my comprehensive reply. :slight_smile: