if the last operation was a replcae, set pattern to last
authorfm
Thu, 26 Jun 2008 16:29:43 +0200
changeset 3650 f3132c5a61a3
parent 3649 36c3b9d8bef3
child 3651 c47e8c3583cf
if the last operation was a replcae, set pattern to last original string (for search after again)
EditTextView.st
--- a/EditTextView.st	Tue Jun 24 16:48:28 2008 +0200
+++ b/EditTextView.st	Thu Jun 26 16:29:43 2008 +0200
@@ -6640,6 +6640,22 @@
     |sel searchPattern|
 
     "/
+    "/ if the last operation was a replcae, set pattern to last
+    "/ original string (for search after again)
+    "/
+
+    (lastString notNil
+     and:[lastReplacement notNil
+     and:[typeOfSelection ~~ #search]]) ifTrue:[
+        lastString isString ifTrue:[
+            searchPattern := lastString.
+        ] ifFalse:[
+            searchPattern := lastString asStringWithoutFinalCR.
+        ].
+        ^ searchPattern
+    ].
+
+    "/
     "/ if there is a selection:
     "/    if there was no previous search, take it as search pattern.
     "/    if there was a previous search, only take the selection if
@@ -7292,5 +7308,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.433 2008-06-13 09:01:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.434 2008-06-26 14:29:43 fm Exp $'
 ! !