--- a/ListView.st Mon Mar 31 18:15:03 2008 +0200
+++ b/ListView.st Wed Apr 02 13:57:58 2008 +0200
@@ -4207,7 +4207,7 @@
"Modified: 13.9.1997 / 01:07:36 / cg"
!
-searchForwardFor:pattern ignoreCase:ignCase startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2
+searchForwardFor:pattern ignoreCase:ignCase match: match startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2
"search for a pattern, if found evaluate block1 with row/col as arguments, if not
found evaluate block2."
@@ -4224,7 +4224,8 @@
line1 := startLine.
line2 := list size.
- pattern includesUnescapedMatchCharacters ifTrue:[
+ (match and:[pattern includesUnescapedMatchCharacters]) ifTrue:[
+ "perform a findMatchString (matching)"
p := pattern species new:0.
(pattern startsWith:$*) ifFalse:[
p := p , '*'
@@ -4256,25 +4257,19 @@
col := 1
]
] ifFalse:[
- p := pattern withoutMatchEscapes.
+ "perform a findString (no matching)"
+ p := pattern "withoutMatchEscapes".
line1 to:line2 do:[:lnr |
lineString := list at:lnr.
lineString notNil ifTrue:[
lineString := lineString asString
].
lineString isString ifTrue:[
- ignCase ifTrue:[
- col := lineString
- findMatchString:p
- startingAt:col
- ignoreCase:ignCase
- ifAbsent:0.
- ] ifFalse:[
- col := lineString
- findString:p
- startingAt:col
- ifAbsent:0.
- ].
+ col := lineString
+ findString:p
+ startingAt:col
+ ifAbsent:0
+ caseSensitive: ignCase not.
col ~~ 0 ifTrue:[
^ block1 value:lnr value:col.
]
@@ -4292,6 +4287,13 @@
"Modified: 13.9.1997 / 01:11:28 / cg"
!
+searchForwardFor:pattern ignoreCase:ignCase startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2
+ "search for a pattern, if found evaluate block1 with row/col as arguments, if not
+ found evaluate block2."
+
+ self searchForwardFor:pattern ignoreCase:ignCase match: true startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2
+!
+
searchForwardFor:pattern startingAtLine:startLine col:startCol ifFound:block1 ifAbsent:block2
"search for a pattern, if found evaluate block1 with row/col as arguments, if not
found evaluate block2."
@@ -4521,5 +4523,5 @@
!ListView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.323 2008-03-08 10:55:33 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.324 2008-04-02 11:57:58 fm Exp $'
! !