searchForward with match argument
authorfm
Wed, 02 Apr 2008 13:58:41 +0200
changeset 3578 9d43beca1e85
parent 3577 092957d43987
child 3579 3923810267b6
searchForward with match argument
EditTextView.st
--- a/EditTextView.st	Wed Apr 02 13:58:30 2008 +0200
+++ b/EditTextView.st	Wed Apr 02 13:58:41 2008 +0200
@@ -6369,7 +6369,7 @@
     self searchFwd:pattern ignoreCase:false startingAtLine:startLine col:startCol ifAbsent:aBlock
 !
 
-setSearchPattern
+setSearchPatternWithMatchEscapes: match
     "set the searchpattern from the selection if there is one, and position
      cursor to start of pattern"
 
@@ -6382,12 +6382,12 @@
     (lastString notNil
      and:[lastReplacement notNil
      and:[typeOfSelection ~~ #search]]) ifTrue:[
-	lastString isString ifTrue:[
-	    lastSearchPattern := lastString.
-	] ifFalse:[
-	    lastSearchPattern := lastString asStringWithoutFinalCR.
-	].
-	^ self
+        lastString isString ifTrue:[
+            lastSearchPattern := lastString.
+        ] ifFalse:[
+            lastSearchPattern := lastString asStringWithoutFinalCR.
+        ].
+        ^ self
     ].
 
     "/
@@ -6399,11 +6399,12 @@
     "/
     sel := self selection.
     sel notNil ifTrue:[
-	(lastSearchPattern isNil
-	or:[typeOfSelection ~~ #paste]) ifTrue:[
-	    self cursorLine:selectionStartLine col:selectionStartCol.
-	    lastSearchPattern := sel asStringWithoutFinalCR withMatchEscapes
-	]
+        (lastSearchPattern isNil
+        or:[typeOfSelection ~~ #paste]) ifTrue:[
+            self cursorLine:selectionStartLine col:selectionStartCol.
+            lastSearchPattern := sel asStringWithoutFinalCR.
+            match ifTrue:[lastSearchPattern := lastSearchPattern withMatchEscapes].
+        ]
     ]
 
     "Modified: 20.4.1996 / 12:50:13 / cg"
@@ -7229,5 +7230,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.427 2008-03-10 09:28:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.428 2008-04-02 11:58:41 fm Exp $'
 ! !