Hi All,
I tried to do a text diff using DiffMorph.
But if compared strings contain CR character, the display seems not be accurate.
Example:
s1 := 'ab', String space, String cr, 'd', String space, String cr, 'ef'.
s2 := 'ab', String cr, 'd', String cr, 'ef'.
(DiffMorph
from: s1
to: s2)
openInWindow.
In this example, d (on line 2) is highlighted while it should not IMHO.
I track this until (a DiffMorph uses a TextDiffBuilder):
TextDiffBuilder>>buildPatchSequence
^Array streamContents: [ :stream |
self
patchSequenceDoIfMatch: [ :string |
stream nextPut: #match -> (string copyWithout: Character cr) ]
ifInsert: [ :string |
stream nextPut: #insert -> (string copyWithout: Character cr) ]
ifRemove: [ :string |
stream nextPut: #remove -> (string copyWithout: Character cr) ] ]
My question: why ignoring Character cr?
Should we change it?
#Luc