TextCollector.st
changeset 1562 9b7557a81849
parent 1504 3101f410e230
child 1565 9109e9848c6f
--- a/TextCollector.st	Wed Jun 10 19:09:06 1998 +0200
+++ b/TextCollector.st	Wed Jun 10 20:04:29 1998 +0200
@@ -13,7 +13,7 @@
 EditTextView subclass:#TextCollector
 	instanceVariableNames:'entryStream lineLimit destroyAction outstandingLines
 		outstandingLine flushBlock flushPending inFlush collecting
-		timeDelay access currentEmphasis'
+		timeDelay access currentEmphasis alwaysAppendAtEnd collectSize'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Views-Text'
@@ -199,7 +199,9 @@
                 nLines := lines size.
                 (nLines ~~ 0) ifTrue:[
                     self insertLines:lines withCR:true.
-                    self cursorToEnd.
+                    alwaysAppendAtEnd ifTrue:[
+                        self cursorToEnd.
+                    ].
                     self withCursorOffDo:[
                         (cursorLine >= (firstLineShown + nFullLinesShown)) ifTrue:[
                             self scrollDown:nLines
@@ -224,7 +226,7 @@
         self installDelayedUpdate
     ]
 
-    "Modified: / 7.4.1998 / 09:45:32 / cg"
+    "Modified: / 10.6.1998 / 19:21:44 / cg"
 !
 
 lineLimit:aNumber
@@ -302,6 +304,8 @@
     super initialize.
 
     outstandingLines := nil.
+    alwaysAppendAtEnd := true.
+    collectSize := 50.
 
     flushBlock := [self endEntry].
     flushPending := inFlush := false.
@@ -314,7 +318,7 @@
     entryStream nextPutBlock:[:something | self nextPut:something].
     entryStream nextPutAllBlock:[:something | self nextPutAll:something]
 
-    "Modified: 11.1.1997 / 14:35:32 / cg"
+    "Modified: / 10.6.1998 / 19:34:12 / cg"
 !
 
 mapped
@@ -526,16 +530,14 @@
     (aString includes:(Character cr)) ifTrue:[
         lines := aString asStringCollection.
         lines keysAndValuesDo:[:nr :line |
-            nr == lines size ifTrue:[
+            (nr == lines size 
+            and:[(aString endsWith:(Character cr)) not]) ifTrue:[
                 "/ the last one.
                 self show:line
             ] ifFalse:[
                 self showCR:line
             ].
         ].
-        (aString endsWith:(Character cr)) ifTrue:[
-            self cr.
-        ].
         ^ self.
     ].
 
@@ -549,7 +551,7 @@
             flushPending ifFalse:[
                 self installDelayedUpdate
             ] ifTrue:[
-                outstandingLines size > 50 ifTrue:[
+                outstandingLines size > collectSize ifTrue:[
                     self endEntry
                 ]
             ]
@@ -558,7 +560,7 @@
         ]
     ].
 
-    "Modified: / 20.4.1998 / 12:15:43 / cg"
+    "Modified: / 10.6.1998 / 19:34:25 / cg"
 ! !
 
 !TextCollector methodsFor:'transcript specials'!
@@ -601,5 +603,5 @@
 !TextCollector class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.46 1998-04-24 18:46:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.47 1998-06-10 18:04:29 cg Exp $'
 ! !