#BUGFIX by cg expecco_18_2_1
authorClaus Gittinger <cg@exept.de>
Fri, 08 Feb 2019 15:26:22 +0100
changeset 6522 6136bb31f689
parent 6521 50187ac791ee
child 6523 88ade82f7c35
#BUGFIX by cg class: ListView changed: #withTabs:expand:
ListView.st
--- a/ListView.st	Sat Feb 02 04:30:36 2019 +0000
+++ b/ListView.st	Fri Feb 08 15:26:22 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -5355,39 +5353,46 @@
     tmpString := line species new:currentMax.
     dstIndex := 1.
     line do:[:character |
-	(character == (Character tab)) ifTrue:[
-	    nextTab := self nextTabAfter:dstIndex in:tabulatorTable.
-	    [dstIndex < nextTab] whileTrue:[
-		tmpString at:dstIndex put:(Character space).
-		dstIndex := dstIndex + 1
-	    ]
-	] ifFalse:[
-	    tmpString at:dstIndex put:character.
-	    dstIndex := dstIndex + 1
-	].
-	(dstIndex > currentMax) ifTrue:[
-	    "
-	     this cannot happen with <= 8 tabs
-	    "
-	    currentMax := currentMax + currentMax.
-	    nString := line species new:currentMax.
-	    nString replaceFrom:1 to:(dstIndex - 1)
-			   with:tmpString startingAt:1.
-	    tmpString := nString.
-	    nString := nil
-	].
-
-	"make stc-optimizer happy
-	 - no need to return value of ifTrue:/ifFalse above"
-	0
+        (character == (Character tab)) ifTrue:[
+            nextTab := self nextTabAfter:dstIndex in:tabulatorTable.
+            tmpString size < nextTab ifTrue:[
+                currentMax := currentMax * 2.
+                nString := line species new:currentMax.
+                nString replaceFrom:1 to:(dstIndex - 1) with:tmpString startingAt:1.
+                tmpString := nString.
+                nString := nil
+            ].        
+            [dstIndex < nextTab] whileTrue:[
+                tmpString at:dstIndex put:(Character space).
+                dstIndex := dstIndex + 1
+            ]
+        ] ifFalse:[
+            tmpString at:dstIndex put:character.
+            dstIndex := dstIndex + 1
+        ].
+        (dstIndex > currentMax) ifTrue:[
+            "
+             this cannot happen with <= 8 tabs
+            "
+            currentMax := currentMax * 2.
+            nString := line species new:currentMax.
+            nString replaceFrom:1 to:(dstIndex - 1) with:tmpString startingAt:1.
+            tmpString := nString.
+            nString := nil
+        ].
+
+        "make stc-optimizer happy
+         - no need to return value of ifTrue:/ifFalse above"
+        0
     ].
     dstIndex := dstIndex - 1.
     dstIndex == currentMax ifTrue:[
-	^ tmpString
+        ^ tmpString
     ].
     ^ tmpString copyTo:dstIndex
 
-    "Modified: 23.2.1996 / 19:11:01 / cg"
+    "Modified: / 23-02-1996 / 19:11:01 / cg"
+    "Modified: / 08-02-2019 / 15:25:49 / Claus Gittinger"
 !
 
 withTabsExpanded:line