--- a/TextView.st Sat May 07 14:46:59 2016 +0200
+++ b/TextView.st Sat May 07 15:28:42 2016 +0200
@@ -4403,33 +4403,41 @@
!
searchUsingSearchAction:direction
+ "search using a searchaction which has been given by someone else.
+ Typically, this is the embedding browser, which has provided an action for
+ a language aware search (as opposed to a naive string search)"
+
self
- searchUsingSearchAction:direction
- ifAbsent:[
- self sensor compressKeyPressEventsWithKey:#FindNext.
- self showNotFound
- ]
+ searchUsingSearchAction:direction
+ ifAbsent:[
+ self sensor compressKeyPressEventsWithKey:#FindNext.
+ self showNotFound
+ ]
!
searchUsingSearchAction:direction ifAbsent:notFoundAction
+ "search using a searchaction which has been given by someone else.
+ Typically, this is the embedding browser, which has provided an action for
+ a language aware search (as opposed to a naive string search)"
+
|pos startLine startCol|
pos := direction == #backward
- ifTrue:[self startPositionForSearchBackward]
- ifFalse:[self startPositionForSearchForward].
+ ifTrue:[self startPositionForSearchBackward]
+ ifFalse:[self startPositionForSearchForward].
startLine := pos y.
startCol := pos x.
searchAction notNil ifTrue:[
- searchAction
- value:direction
- value:startLine
- value:startCol
- value:[:line :col | self selectFromLine:line toLine:line]
- value:notFoundAction.
- self hasSelection ifTrue: [
- self changeTypeOfSelectionTo: #searchAction.
- ].
+ searchAction
+ value:direction
+ value:startLine
+ value:startCol
+ value:[:line :col | self selectFromLine:line toLine:line]
+ value:notFoundAction.
+ self hasSelection ifTrue: [
+ self changeTypeOfSelectionTo: #searchAction.
+ ].
].
!