care for insertMode when handling collected text.
authorClaus Gittinger <cg@exept.de>
Thu, 11 Jun 1998 10:54:51 +0200
changeset 1565 9109e9848c6f
parent 1564 04c13358013e
child 1566 4e37a55bd140
care for insertMode when handling collected text.
TextColl.st
TextCollector.st
--- a/TextColl.st	Thu Jun 11 10:43:14 1998 +0200
+++ b/TextColl.st	Thu Jun 11 10:54:51 1998 +0200
@@ -198,7 +198,11 @@
 
                 nLines := lines size.
                 (nLines ~~ 0) ifTrue:[
-                    self insertLines:lines withCR:true.
+                    insertMode ifTrue:[
+                        self insertLines:lines withCR:true.
+                    ] ifFalse:[
+                        self replaceLines:lines withCR:true
+                    ].
                     alwaysAppendAtEnd ifTrue:[
                         self cursorToEnd.
                     ].
@@ -212,7 +216,11 @@
 
             "and the last partial line - if any"
             outstandingLine size > 0 ifTrue:[
-                self insertStringAtCursor:outstandingLine.
+                insertMode ifTrue:[
+                    self insertStringAtCursor:outstandingLine.
+                ] ifFalse:[
+                    self replaceStringAtCursor:outstandingLine.
+                ].
                 outstandingLine := ''.
             ].
             self checkLineLimit.
@@ -226,7 +234,7 @@
         self installDelayedUpdate
     ]
 
-    "Modified: / 10.6.1998 / 19:21:44 / cg"
+    "Modified: / 11.6.1998 / 10:39:02 / cg"
 !
 
 lineLimit:aNumber
@@ -603,5 +611,5 @@
 !TextCollector class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/TextColl.st,v 1.47 1998-06-10 18:04:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/TextColl.st,v 1.48 1998-06-11 08:54:51 cg Exp $'
 ! !
--- a/TextCollector.st	Thu Jun 11 10:43:14 1998 +0200
+++ b/TextCollector.st	Thu Jun 11 10:54:51 1998 +0200
@@ -198,7 +198,11 @@
 
                 nLines := lines size.
                 (nLines ~~ 0) ifTrue:[
-                    self insertLines:lines withCR:true.
+                    insertMode ifTrue:[
+                        self insertLines:lines withCR:true.
+                    ] ifFalse:[
+                        self replaceLines:lines withCR:true
+                    ].
                     alwaysAppendAtEnd ifTrue:[
                         self cursorToEnd.
                     ].
@@ -212,7 +216,11 @@
 
             "and the last partial line - if any"
             outstandingLine size > 0 ifTrue:[
-                self insertStringAtCursor:outstandingLine.
+                insertMode ifTrue:[
+                    self insertStringAtCursor:outstandingLine.
+                ] ifFalse:[
+                    self replaceStringAtCursor:outstandingLine.
+                ].
                 outstandingLine := ''.
             ].
             self checkLineLimit.
@@ -226,7 +234,7 @@
         self installDelayedUpdate
     ]
 
-    "Modified: / 10.6.1998 / 19:21:44 / cg"
+    "Modified: / 11.6.1998 / 10:39:02 / cg"
 !
 
 lineLimit:aNumber
@@ -603,5 +611,5 @@
 !TextCollector class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.47 1998-06-10 18:04:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.48 1998-06-11 08:54:51 cg Exp $'
 ! !