dont show matching parents when executing a keyboard macros
authorClaus Gittinger <cg@exept.de>
Thu, 22 Jan 2009 00:26:46 +0100
changeset 3813 8d719ca5812d
parent 3812 712b5b68c378
child 3814 54fbca99c942
dont show matching parents when executing a keyboard macros
EditTextView.st
--- a/EditTextView.st	Wed Jan 21 20:59:14 2009 +0100
+++ b/EditTextView.st	Thu Jan 22 00:26:46 2009 +0100
@@ -78,6 +78,13 @@
 	privateIn:EditTextView::EditMode
 !
 
+Query subclass:#ExecutingMacroQuery
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:EditTextView
+!
+
 EditTextView::EditAction subclass:#PasteString
 	instanceVariableNames:'line col string selected'
 	classVariableNames:''
@@ -4642,15 +4649,15 @@
     |selStartLine selStartCol selEndLine selEndCol sel key|
 
     self isReadOnly ifTrue:[
-	self flash.
-	^ self.
+        self flash.
+        ^ self.
     ].
 
     key := keyArg.
 
     typeOfSelection == #paste ifTrue:[
-	"pasted selection will NOT be replaced by keystroke"
-	self unselect
+        "pasted selection will NOT be replaced by keystroke"
+        self unselect
     ].
 
     selStartLine := selectionStartLine.
@@ -4660,7 +4667,7 @@
     sel := self selection.
 
     (characterEncoding ? #'iso10646-1') ~~ #'iso10646-1' ifTrue:[
-	key := CharacterEncoder encode:key from:#'iso10646-1' into:characterEncoding.
+        key := CharacterEncoder encode:key from:#'iso10646-1' into:characterEncoding.
     ].
 
     "replace selection by what is typed in -
@@ -4668,64 +4675,65 @@
      if there was no selection, the keys character is inserted"
 
     editMode value isInsertAndSelectMode ifTrue:[
-	selectionStartLine := selectionStartCol := selectionEndLine := selectionEndCol := nil.
+        selectionStartLine := selectionStartCol := selectionEndLine := selectionEndCol := nil.
     ].
 
     (selectStyle == #wordLeft) ifTrue:[
-	self replaceSelectionBy:(' ' , key asString)
+        self replaceSelectionBy:(' ' , key asString)
     ] ifFalse:[
-	(selectStyle == #wordRight) ifTrue:[
-	    self replaceSelectionBy:(key asString , ' ').
-	    self cursorLeft
-	] ifFalse:[
-	    self replaceSelectionBy:key
-	]
+        (selectStyle == #wordRight) ifTrue:[
+            self replaceSelectionBy:(key asString , ' ').
+            self cursorLeft
+        ] ifFalse:[
+            self replaceSelectionBy:key
+        ]
     ].
     selectStyle := nil.
 
     editMode value isInsertAndSelectMode ifTrue:[
-	selectionStartLine := selStartLine.
-	selectionStartCol := selStartCol.
-	selectionEndLine := selEndLine.
-	selectionEndCol := selEndCol.
+        selectionStartLine := selStartLine.
+        selectionStartCol := selStartCol.
+        selectionEndLine := selEndLine.
+        selectionEndCol := selEndCol.
     ].
 
     showMatchingParenthesis ifTrue:[
-	"emacs style parenthesis shower"
-
-	"claus: only do it for closing parenthesis -
-		otherwise its too anoying.
-	"
+        "emacs style parenthesis shower"
+      (ExecutingMacroQuery query ? false) ifFalse:[
+        "claus: only do it for closing parenthesis -
+                otherwise its too anoying.
+        "
 "
-	(#( $( $) $[ $] ${ $} ) includes:key) ifTrue:[
+        (#( $( $) $[ $] ${ $} ) includes:key) ifTrue:[
 "
-	(#( $) $] $} ) includes:key) ifTrue:[
-	self
-	    searchForMatchingParenthesisFromLine:cursorLine col:(cursorCol - 1)
-	    ifFound:[:line :col |
-			 |savLine savCol sensor|
-
-			 self withCursor:Cursor eye do:[
-			     savLine := cursorLine.
-			     savCol := cursorCol.
-			     self cursorLine:line col:col.
-			     device flush.
-
-			     "/ want to wait 200ms, but not if another keyPress
-			     "/ arrives in the meantime ...
-
-			     sensor := self sensor.
-			     5 timesRepeat:[
-				 (sensor hasKeyPressEventFor:self) ifFalse:[
-				     Processor activeProcess millisecondDelay:40.
-				 ]
-			     ].
-			     self cursorLine:savLine col:savCol
-			 ]
-		    ]
-	    ifNotFound:[self showNotFound]
-	    onError:[self beep]
-	].
+        (#( $) $] $} ) includes:key) ifTrue:[
+        self
+            searchForMatchingParenthesisFromLine:cursorLine col:(cursorCol - 1)
+            ifFound:[:line :col |
+                         |savLine savCol sensor|
+
+                         self withCursor:Cursor eye do:[
+                             savLine := cursorLine.
+                             savCol := cursorCol.
+                             self cursorLine:line col:col.
+                             device flush.
+
+                             "/ want to wait 200ms, but not if another keyPress
+                             "/ arrives in the meantime ...
+
+                             sensor := self sensor.
+                             5 timesRepeat:[
+                                 (sensor hasKeyPressEventFor:self) ifFalse:[
+                                     Processor activeProcess millisecondDelay:40.
+                                 ]
+                             ].
+                             self cursorLine:savLine col:savCol
+                         ]
+                    ]
+            ifNotFound:[self showNotFound]
+            onError:[self beep]
+        ].
+      ]
     ].
 
 "/    true "autoExpandWhileTyping" ifTrue:[
@@ -4738,11 +4746,11 @@
 "/        ].
 "/    ].
     editMode value isInsertAndSelectMode ifTrue:[
-	selectionStartLine isNil ifTrue:[
-	    self selectFromLine:cursorLine col:cursorCol-1 toLine:cursorLine col:cursorCol-1.
-	] ifFalse:[
-	    self selectFromLine:selectionStartLine col:selectionStartCol toLine:cursorLine col:cursorCol-1.
-	].
+        selectionStartLine isNil ifTrue:[
+            self selectFromLine:cursorLine col:cursorCol-1 toLine:cursorLine col:cursorCol-1.
+        ] ifFalse:[
+            self selectFromLine:selectionStartLine col:selectionStartCol toLine:cursorLine col:cursorCol-1.
+        ].
     ].
 !
 
@@ -5009,17 +5017,21 @@
 
 executeLearnedKeyboardMacro
     (self learnMode not and:[learnedMacro size > 0]) ifTrue:[
-	learnedMacro do:[:event |
-			    WindowGroup lastEventQuerySignal answer:event
-			    do:[
-				self
-				    dispatchEvent:event
-				    withFocusOn:nil
-				    delegate:false
-			    ]
-			].
+        ExecutingMacroQuery 
+            answer:true
+            do:[
+                learnedMacro do:[:event |
+                            WindowGroup lastEventQuerySignal answer:event
+                            do:[
+                                self
+                                    dispatchEvent:event
+                                    withFocusOn:nil
+                                    delegate:false
+                            ]
+                ]
+            ].
     ] ifFalse:[
-	self flash.
+        self flash.
     ].
 !
 
@@ -7414,5 +7426,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.451 2009-01-15 17:40:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.452 2009-01-21 23:26:46 cg Exp $'
 ! !