diff -r 47e0a1faf544 -r 3e1ee2bbab6b TextView.st --- a/TextView.st Tue Nov 27 18:32:05 2001 +0100 +++ b/TextView.st Tue Nov 27 19:01:17 2001 +0100 @@ -1545,6 +1545,14 @@ saveAs:fileName "save the contents into a file named fileName" + ^ self saveAs:fileName doAppend:false +! + +saveAs:fileName doAppend:doAppend + "save the contents into a file named fileName; + if doAppend is true, the views contents is appended to the existing + contents - otherwise, it overwrites any previous file contents." + self withCursor:Cursor write do:[ |aStream msg| @@ -1555,7 +1563,11 @@ ]. FileStream openErrorSignal catch:[ - aStream := FileStream newFileNamed:fileName. + doAppend ifTrue:[ + aStream := FileStream appendingOldFileNamed:fileName + ] ifFalse:[ + aStream := FileStream newFileNamed:fileName. + ] ]. aStream isNil ifTrue:[ msg := resources string:'cannot write file ''%1'' !!' with:fileName. @@ -3232,5 +3244,5 @@ !TextView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.175 2001-11-12 12:47:27 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.176 2001-11-27 18:01:17 cg Exp $' ! !