--- a/DiffTextView.st Fri Aug 14 22:34:55 2009 +0200
+++ b/DiffTextView.st Fri Aug 14 22:35:22 2009 +0200
@@ -352,7 +352,7 @@
stream := filename writeStream.
text do:[:line |
- |lOut|
+ |lOut i|
line notEmptyOrNil ifTrue:[
lOut := line.
@@ -360,7 +360,14 @@
(line endsWith:Character return) ifTrue:[
lOut := line copyWithoutLast:1.
] ifFalse:[
- self error:'oops - funny line (includes returns) in text' mayProceed:true.
+ i := line indexOf:Character return.
+ (line at:i+1) == Character nl ifTrue:[
+ "/ crnl endings
+ lOut := line copyReplaceString:(String crlf) withString:(String lf).
+ ] ifFalse:[
+ "/ cr endings
+ lOut := line copyReplaceAll:Character return with:Character nl.
+ ].
]
].
lOut bitsPerCharacter > 8 ifTrue:[
@@ -681,5 +688,5 @@
!DiffTextView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/DiffTextView.st,v 1.54 2009-06-12 09:13:25 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/DiffTextView.st,v 1.55 2009-08-14 20:35:22 cg Exp $'
! !