avoid match: if possible (to not clobber the previous matchString)
authorClaus Gittinger <cg@exept.de>
Wed, 02 Apr 1997 17:32:39 +0200
changeset 1177 9d23e1241404
parent 1176 29d0a646cbdf
child 1178 c221e0f8cbb6
avoid match: if possible (to not clobber the previous matchString)
ETxtView.st
EditTextView.st
TextView.st
--- a/ETxtView.st	Wed Apr 02 16:16:51 1997 +0200
+++ b/ETxtView.st	Wed Apr 02 17:32:39 1997 +0200
@@ -2650,17 +2650,19 @@
 
      see TextView>>:x:y
     "
-    (('[fF][0-9]' match:key)
-    or:['[fF][0-9][0-9]' match:key]) ifTrue:[
-        shifted ifFalse:[
-            fKeyMacros := Smalltalk at:#FunctionKeySequences.
-            fKeyMacros notNil ifTrue:[
-                (fKeyMacros includesKey:key) ifTrue:[
-                    self pasteOrReplace:(fKeyMacros at:key) asStringCollection.
-                    ^ self
+    (key at:1) asLowercase == $f ifTrue:[
+        (('[fF][0-9]' match:key)
+        or:['[fF][0-9][0-9]' match:key]) ifTrue:[
+            shifted ifFalse:[
+                fKeyMacros := Smalltalk at:#FunctionKeySequences.
+                fKeyMacros notNil ifTrue:[
+                    (fKeyMacros includesKey:key) ifTrue:[
+                        self pasteOrReplace:(fKeyMacros at:key) asStringCollection.
+                        ^ self
+                    ]
                 ]
             ]
-        ]
+        ].
     ].
 
     (key == #Accept)  ifTrue:[^ self accept].
@@ -2944,7 +2946,7 @@
     ].
     super keyPress:key x:x y:y
 
-    "Modified: 9.1.1997 / 12:23:51 / cg"
+    "Modified: 2.4.1997 / 16:45:24 / cg"
 !
 
 mapped
@@ -4028,5 +4030,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.119 1997-03-07 10:16:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.120 1997-04-02 15:32:02 cg Exp $'
 ! !
--- a/EditTextView.st	Wed Apr 02 16:16:51 1997 +0200
+++ b/EditTextView.st	Wed Apr 02 17:32:39 1997 +0200
@@ -2650,17 +2650,19 @@
 
      see TextView>>:x:y
     "
-    (('[fF][0-9]' match:key)
-    or:['[fF][0-9][0-9]' match:key]) ifTrue:[
-        shifted ifFalse:[
-            fKeyMacros := Smalltalk at:#FunctionKeySequences.
-            fKeyMacros notNil ifTrue:[
-                (fKeyMacros includesKey:key) ifTrue:[
-                    self pasteOrReplace:(fKeyMacros at:key) asStringCollection.
-                    ^ self
+    (key at:1) asLowercase == $f ifTrue:[
+        (('[fF][0-9]' match:key)
+        or:['[fF][0-9][0-9]' match:key]) ifTrue:[
+            shifted ifFalse:[
+                fKeyMacros := Smalltalk at:#FunctionKeySequences.
+                fKeyMacros notNil ifTrue:[
+                    (fKeyMacros includesKey:key) ifTrue:[
+                        self pasteOrReplace:(fKeyMacros at:key) asStringCollection.
+                        ^ self
+                    ]
                 ]
             ]
-        ]
+        ].
     ].
 
     (key == #Accept)  ifTrue:[^ self accept].
@@ -2944,7 +2946,7 @@
     ].
     super keyPress:key x:x y:y
 
-    "Modified: 9.1.1997 / 12:23:51 / cg"
+    "Modified: 2.4.1997 / 16:45:24 / cg"
 !
 
 mapped
@@ -4028,5 +4030,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.119 1997-03-07 10:16:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.120 1997-04-02 15:32:02 cg Exp $'
 ! !
--- a/TextView.st	Wed Apr 02 16:16:51 1997 +0200
+++ b/TextView.st	Wed Apr 02 17:32:39 1997 +0200
@@ -838,20 +838,22 @@
 
      (see EditTextView>>keyPress:x:y and Workspace>>keyPress:x:y)
     "
-    (('[fF][0-9]' match:key)
-    or:['[fF][0-9][0-9]' match:key]) ifTrue:[
-        self sensor shiftDown ifTrue:[
-            (Smalltalk at:#FunctionKeySequences) isNil ifTrue:[
-                Smalltalk at:#FunctionKeySequences put:Dictionary new
+    (key at:1) asLowercase == $f ifTrue:[
+        (('[fF][0-9]' match:key)
+        or:['[fF][0-9][0-9]' match:key]) ifTrue:[
+            self sensor shiftDown ifTrue:[
+                (Smalltalk at:#FunctionKeySequences) isNil ifTrue:[
+                    Smalltalk at:#FunctionKeySequences put:Dictionary new
+                ].
+                (Smalltalk at:#FunctionKeySequences) at:key put:(self selection)
             ].
-            (Smalltalk at:#FunctionKeySequences) at:key put:(self selection)
+            ^ self
         ].
-        ^ self
     ].
 
     super keyPress:key x:x y:y
 
-    "Modified: 9.1.1997 / 12:18:14 / cg"
+    "Modified: 2.4.1997 / 16:48:26 / cg"
 !
 
 mapped 
@@ -2433,5 +2435,5 @@
 !TextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.92 1997-03-19 21:24:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.93 1997-04-02 15:32:39 cg Exp $'
 ! !