try ignoring case in classNameCompletion
authorClaus Gittinger <cg@exept.de>
Thu, 03 Apr 1997 18:25:42 +0200
changeset 2523 04db1fd74e0d
parent 2522 4e9a6a3fb8c5
child 2524 9304e01f8f25
try ignoring case in classNameCompletion
Smalltalk.st
--- a/Smalltalk.st	Thu Apr 03 18:00:56 1997 +0200
+++ b/Smalltalk.st	Thu Apr 03 18:25:42 1997 +0200
@@ -10,8 +10,6 @@
  hereby transferred.
 "
 
-'From Smalltalk/X, Version:3.1.3 on 8-jan-1997 at 19:58:18'                     !
-
 Object subclass:#Smalltalk
 	instanceVariableNames:''
 	classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses SystemPath
@@ -1357,7 +1355,7 @@
      2 entries: 1st: collection consisting of matching names
                 2nd: the best (longest) match"
 
-    |searchName matches best isMatchString|
+    |searchName matches ignCaseMatches best isMatchString|
 
     searchName := aPartialClassName.
     searchName isEmpty ifTrue:[
@@ -1370,6 +1368,7 @@
 
     isMatchString := searchName includesMatchCharacters.
     matches := OrderedCollection new.
+    ignCaseMatches := OrderedCollection new.
     self allClassesDo:[:aClass |
         |className addIt|
 
@@ -1383,11 +1382,25 @@
             ].
             addIt ifTrue:[
                 matches add:aClass name
+            ] ifFalse:[
+                "/ try ignoring case
+                isMatchString ifTrue:[
+                    addIt := searchName match:className ignoreCase:true
+                ] ifFalse:[
+                    addIt := className asLowercase startsWith:searchName asLowercase
+                ].
+                addIt ifTrue:[
+                    ignCaseMatches add:aClass name
+                ]
             ]
         ]
     ].
 
     matches isEmpty ifTrue:[
+        matches := ignCaseMatches
+    ].
+
+    matches isEmpty ifTrue:[
         ^ Array with:searchName with:(Array with:searchName)
     ].
     matches size == 1 ifTrue:[
@@ -1409,7 +1422,7 @@
     "
 
     "Created: 24.11.1995 / 17:24:45 / cg"
-    "Modified: 4.6.1996 / 11:36:02 / cg"
+    "Modified: 3.4.1997 / 18:25:01 / cg"
 !
 
 defaultNameSpace
@@ -3632,5 +3645,5 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.232 1997-04-01 16:04:03 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.233 1997-04-03 16:25:42 cg Exp $'
 ! !