# HG changeset patch # User Claus Gittinger # Date 932046256 -7200 # Node ID 75d490e87d95368301e2c505d0fc96f147ee8a87 # Parent aad58c8f7c5ac094500058b1729a44493d3893fe oops - care for diff -b space differences diff -r aad58c8f7c5a -r 75d490e87d95 DiffTextView.st --- a/DiffTextView.st Tue Jul 13 17:48:50 1999 +0200 +++ b/DiffTextView.st Thu Jul 15 15:44:16 1999 +0200 @@ -434,7 +434,7 @@ foregroundColor:changedSpacesOnlyColor backgroundColor:changedSpacesOnlyBgColor. - line1 string withoutSeparators = line2 string withoutSeparators ifTrue:[ + line1 string withoutTrailingSeparators = line2 string withoutTrailingSeparators ifTrue:[ line1 := line1 string. line2 := line2 string. ]. @@ -465,7 +465,7 @@ line1 := Text string:line1 asString foregroundColor:changedSpacesOnlyColor backgroundColor:changedSpacesOnlyBgColor. - line1 string withoutSeparators = line2 string withoutSeparators ifTrue:[ + line1 string withoutTrailingSeparators = line2 string withoutTrailingSeparators ifTrue:[ line1 := line1 string. line2 := line2 string. ]. @@ -528,6 +528,31 @@ [l2 size < l1 size] whileTrue:[ l2 add:''. ]. + + "/ fixup - diff -b is ignoring lines which differ in leading space only ... + 1 to:l1 size do:[:idx | + |line1 line2| + + line1 := l1 at:idx. + line2 := l2 at:idx. + line1 hasChangeOfEmphasis not ifTrue:[ + line2 hasChangeOfEmphasis not ifTrue:[ + line1 withTabsExpanded withoutTrailingSeparators + ~= line2 withTabsExpanded withoutTrailingSeparators + ifTrue:[ + line1 := Text string:line1 + foregroundColor:changedSpacesOnlyColor + backgroundColor:changedSpacesOnlyBgColor. + line2 := Text string:line2 + foregroundColor:changedSpacesOnlyColor + backgroundColor:changedSpacesOnlyBgColor. + l1 at:idx put:line1. + l2 at:idx put:line2. + ] + ] + ] + ]. + textView1 list:l1. textView2 list:l2 @@ -537,4 +562,4 @@ !DiffTextView class methodsFor:'documentation'! version -^ '$Header: /cvs/stx/stx/libtool/DiffTextView.st,v 1.26 1999-07-13 12:15:05 cg Exp $'! ! +^ '$Header: /cvs/stx/stx/libtool/DiffTextView.st,v 1.27 1999-07-15 13:44:16 cg Exp $'! ! diff -r aad58c8f7c5a -r 75d490e87d95 DiffTxtV.st --- a/DiffTxtV.st Tue Jul 13 17:48:50 1999 +0200 +++ b/DiffTxtV.st Thu Jul 15 15:44:16 1999 +0200 @@ -434,7 +434,7 @@ foregroundColor:changedSpacesOnlyColor backgroundColor:changedSpacesOnlyBgColor. - line1 string withoutSeparators = line2 string withoutSeparators ifTrue:[ + line1 string withoutTrailingSeparators = line2 string withoutTrailingSeparators ifTrue:[ line1 := line1 string. line2 := line2 string. ]. @@ -465,7 +465,7 @@ line1 := Text string:line1 asString foregroundColor:changedSpacesOnlyColor backgroundColor:changedSpacesOnlyBgColor. - line1 string withoutSeparators = line2 string withoutSeparators ifTrue:[ + line1 string withoutTrailingSeparators = line2 string withoutTrailingSeparators ifTrue:[ line1 := line1 string. line2 := line2 string. ]. @@ -528,6 +528,31 @@ [l2 size < l1 size] whileTrue:[ l2 add:''. ]. + + "/ fixup - diff -b is ignoring lines which differ in leading space only ... + 1 to:l1 size do:[:idx | + |line1 line2| + + line1 := l1 at:idx. + line2 := l2 at:idx. + line1 hasChangeOfEmphasis not ifTrue:[ + line2 hasChangeOfEmphasis not ifTrue:[ + line1 withTabsExpanded withoutTrailingSeparators + ~= line2 withTabsExpanded withoutTrailingSeparators + ifTrue:[ + line1 := Text string:line1 + foregroundColor:changedSpacesOnlyColor + backgroundColor:changedSpacesOnlyBgColor. + line2 := Text string:line2 + foregroundColor:changedSpacesOnlyColor + backgroundColor:changedSpacesOnlyBgColor. + l1 at:idx put:line1. + l2 at:idx put:line2. + ] + ] + ] + ]. + textView1 list:l1. textView2 list:l2 @@ -537,4 +562,4 @@ !DiffTextView class methodsFor:'documentation'! version -^ '$Header: /cvs/stx/stx/libtool/Attic/DiffTxtV.st,v 1.26 1999-07-13 12:15:05 cg Exp $'! ! +^ '$Header: /cvs/stx/stx/libtool/Attic/DiffTxtV.st,v 1.27 1999-07-15 13:44:16 cg Exp $'! !