SystemBrowser.st
changeset 5891 2a0c77668f34
parent 5877 c11a6d244c6a
child 5928 f4c637b9dffa
--- a/SystemBrowser.st	Mon Jun 07 11:11:39 2004 +0200
+++ b/SystemBrowser.st	Mon Jun 07 11:23:31 2004 +0200
@@ -4420,10 +4420,9 @@
 searchBlockForString:aString ignoreCase:ignoreCase match:doMatch
     "return a block to search for a string."
 
-    |searchBlock s|
-
-    ((doMatch and:[ aString includesMatchCharacters ])
-     or:[ignoreCase]) ifTrue:[
+    |searchBlock s lcString|
+
+    (doMatch and:[ aString includesMatchCharacters ]) ifTrue:[
         s := '*' , aString , '*'.
         "a matchString"
         searchBlock := [:c :m :sel | 
@@ -4437,17 +4436,34 @@
                             ]
                        ]
     ] ifFalse:[
-        searchBlock := [:c :m :sel | 
-                            |src|
-
-                            src := m source.
-                            src isNil ifTrue:[
-                                ('Browser [info]: no source for ' , m printString) infoPrintCR.
-                                false
-                            ] ifFalse:[
-                                (src findString:aString) ~~ 0
-                            ]
-                       ]
+        ignoreCase ifTrue:[
+            lcString := aString asLowercase.
+            searchBlock := 
+                [:c :m :sel | 
+                    |src|
+
+                    src := m source.
+                    src isNil ifTrue:[
+                        ('Browser [info]: no source for ' , m printString) infoPrintCR.
+                        false
+                    ] ifFalse:[
+                        (src asLowercase findString:lcString) ~~ 0
+                    ]
+               ]
+        ] ifFalse:[
+            searchBlock := 
+                [:c :m :sel | 
+                    |src|
+
+                    src := m source.
+                    src isNil ifTrue:[
+                        ('Browser [info]: no source for ' , m printString) infoPrintCR.
+                        false
+                    ] ifFalse:[
+                        (src findString:aString) ~~ 0
+                    ]
+               ]
+           ]
     ].
     ^ searchBlock.
 
@@ -4461,8 +4477,7 @@
 
     |searchBlock s|
 
-    ((doMatch and:[ aString includesMatchCharacters ])
-     or:[ignoreCase]) ifTrue:[
+    (doMatch and:[ aString includesMatchCharacters]) ifTrue:[
         s := '*' , aString , '*'.
         "a matchString"
         searchBlock := [:c :m :sel | 
@@ -4475,15 +4490,28 @@
                             ]
                        ]
     ] ifFalse:[
-        searchBlock := [:c :m :sel | 
-                            |lits|       
-                            lits := m literals ? #().
-                            lits contains:[:lit |
-                                lit isString
-                                and:[lit isSymbol not
-                                and:[s = lit]]
-                            ]
-                       ]
+        ignoreCase ifTrue:[
+            s := aString asLowercase.
+            searchBlock := [:c :m :sel | 
+                                |lits|       
+                                lits := m literals ? #().
+                                lits contains:[:lit |
+                                    lit isString
+                                    and:[lit isSymbol not
+                                    and:[s = lit asLowercase]]
+                                ]
+                           ]
+        ] ifFalse:[
+            searchBlock := [:c :m :sel | 
+                                |lits|       
+                                lits := m literals ? #().
+                                lits contains:[:lit |
+                                    lit isString
+                                    and:[lit isSymbol not
+                                    and:[s = lit]]
+                                ]
+                           ]
+        ].
     ].
     ^ searchBlock.
 
@@ -5356,7 +5384,7 @@
 !SystemBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.208 2004-05-19 13:21:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.209 2004-06-07 09:23:31 cg Exp $'
 ! !
 
 SystemBrowser initialize!