added: #hasSearchActionSelection
authorfm
Mon, 02 Nov 2009 16:20:33 +0100
changeset 4064 140eda842f20
parent 4063 6d2caa13cb14
child 4065 13420626ab29
added: #hasSearchActionSelection changed: #setLastStringToReplace: #startPositionForSearchForwardBasedOnCursorOrSelection
EditTextView.st
--- a/EditTextView.st	Mon Nov 02 16:20:14 2009 +0100
+++ b/EditTextView.st	Mon Nov 02 16:20:33 2009 +0100
@@ -6280,6 +6280,9 @@
 
     |lastReplaceIgnoredCase|
 
+    "/ The searchAction is mantained until a cut/replace or a search with a user selection is done
+    self clearSearchAction.
+
     lastReplacementInfo lastStringToReplace: aString.
     lastStringFromReplaceForNextSearch := aString.
 
@@ -6333,6 +6336,11 @@
     "Created: / 17.5.1998 / 20:07:52 / cg"
 !
 
+hasSearchActionSelection
+
+    ^ typeOfSelection == #searchAction
+!
+
 isKeyboardConsumer
     "return true, if the receiver is a keyboard consumer;
      Return true here, redefined from SimpleView."
@@ -6771,9 +6779,10 @@
     "/ assume its the first search and do not skip the very first match
     startCol := cursorCol.
     self hasSelection ifFalse:[
-	(cursorLine == 1 and:[cursorCol == 1]) ifTrue:[
-	    startCol := 0
-	]
+        (cursorLine == 1 and:[cursorCol == 1]) ifTrue:[
+            startCol := 0
+        ].
+        startCol := startCol min:(self at:cursorLine) size
     ].
 
     ^ startCol @ cursorLine
@@ -7650,9 +7659,9 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.474 2009-10-30 10:11:23 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.475 2009-11-02 15:20:33 fm Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.474 2009-10-30 10:11:23 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.475 2009-11-02 15:20:33 fm Exp $'
 ! !