diff options
Diffstat (limited to 'org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java')
-rw-r--r-- | org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java b/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java index 20153779899..9dc71a52d50 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java @@ -113,7 +113,7 @@ public class FindReplaceDocumentAdapter implements CharSequence { * @throws IllegalStateException if a REPLACE or REPLACE_FIND operation is not preceded by a successful FIND operation * @throws PatternSyntaxException if a regular expression has invalid syntax */ - private IRegion findReplace(FindReplaceOperationCode operationCode, int startOffset, String findString, String replaceText, boolean forwardSearch, boolean caseSensitive, boolean wholeWord, boolean regExSearch) throws BadLocationException { + private IRegion findReplace(final FindReplaceOperationCode operationCode, int startOffset, String findString, String replaceText, boolean forwardSearch, boolean caseSensitive, boolean wholeWord, boolean regExSearch) throws BadLocationException { // Validate option combinations Assert.isTrue(!(regExSearch && wholeWord)); @@ -190,7 +190,8 @@ public class FindReplaceDocumentAdapter implements CharSequence { else found= fFindReplaceMatcher.find(); - fFindReplaceState= operationCode; + if (operationCode == REPLACE_FIND_NEXT) + fFindReplaceState= FIND_NEXT; if (found && fFindReplaceMatcher.group().length() > 0) { return new Region(fFindReplaceMatcher.start(), fFindReplaceMatcher.group().length()); |