TextStream.st
changeset 2053 7592e3ecdca4
parent 1943 63b23152a6d2
child 2525 4d6a0a5905e7
--- a/TextStream.st	Thu Nov 06 11:59:28 2008 +0100
+++ b/TextStream.st	Thu Nov 06 12:00:39 2008 +0100
@@ -212,8 +212,31 @@
     ]
 ! !
 
+!TextStream methodsFor:'writing'!
+
+nextPutAllText:aText
+    "write some text to the stream and keep the emphasis"
+
+    |string pos oldEmphasis|
+
+    string := aText string.
+    pos := 1.
+
+    oldEmphasis := currentEmphasis.
+    aText emphasis runsDo:[:len :emphasis |
+        |nextPos|
+
+        nextPos := pos + len.
+
+        self emphasis:emphasis.
+        self nextPutAll:string startingAt:pos to:nextPos - 1.
+        pos := nextPos
+    ].
+    self emphasis:oldEmphasis
+! !
+
 !TextStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/TextStream.st,v 1.11 2008-04-09 06:02:33 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/TextStream.st,v 1.12 2008-11-06 11:00:39 stefan Exp $'
 ! !