Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 74662 Details for
Bug 80661
[find/replace] Regex find does not find next match after greedy *
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Work in Progress
80661_patch1.txt (text/plain), 4.05 KB, created by
Markus Keller
on 2007-07-26 05:26:55 EDT
(
hide
)
Description:
Work in Progress
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2007-07-26 05:26:55 EDT
Size:
4.05 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.text >Index: src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java,v >retrieving revision 1.23 >diff -u -r1.23 FindReplaceDocumentAdapter.java >--- src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java 23 Jul 2007 14:37:04 -0000 1.23 >+++ src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java 26 Jul 2007 08:56:20 -0000 >@@ -120,7 +120,7 @@ > * @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(final FindReplaceOperationCode operationCode, int startOffset, String findString, String replaceText, boolean forwardSearch, boolean caseSensitive, boolean wholeWord, boolean regExSearch) throws BadLocationException { >+ private IRegion findReplace(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)); >@@ -155,6 +155,9 @@ > if (!regExSearch && !wholeWord) > findString= asRegPattern(findString); > >+ if (fFindReplaceMatchOffset == startOffset) >+ operationCode= FIND_NEXT; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=80661 >+ > fFindReplaceMatchOffset= startOffset; > if (fFindReplaceMatcher != null && fFindReplaceMatcher.pattern().pattern().equals(findString) && fFindReplaceMatcher.pattern().flags() == patternFlags) { > /* >@@ -203,8 +206,11 @@ > if (operationCode == REPLACE_FIND_NEXT) > fFindReplaceState= FIND_NEXT; > >- if (found && fFindReplaceMatcher.group().length() > 0) >- return new Region(fFindReplaceMatcher.start(), fFindReplaceMatcher.group().length()); >+ if (found) { >+ fFindReplaceMatchOffset= fFindReplaceMatcher.start(); >+ int end= fFindReplaceMatcher.end(); >+ return new Region(fFindReplaceMatchOffset, end - fFindReplaceMatchOffset); >+ } > return null; > } > >@@ -212,7 +218,7 @@ > boolean found= fFindReplaceMatcher.find(0); > int index= -1; > int length= -1; >- while (found && fFindReplaceMatcher.start() + fFindReplaceMatcher.group().length() <= fFindReplaceMatchOffset + 1) { >+ while (found && fFindReplaceMatcher.start() + fFindReplaceMatcher.group().length() <= fFindReplaceMatchOffset) { > index= fFindReplaceMatcher.start(); > length= fFindReplaceMatcher.group().length(); > found= fFindReplaceMatcher.find(index + 1); >#P org.eclipse.jface.text >Index: src/org/eclipse/jface/text/TextViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java,v >retrieving revision 1.180 >diff -u -r1.180 TextViewer.java >--- src/org/eclipse/jface/text/TextViewer.java 20 Jun 2007 14:30:54 -0000 1.180 >+++ src/org/eclipse/jface/text/TextViewer.java 26 Jul 2007 08:56:31 -0000 >@@ -4222,9 +4222,14 @@ > int length= matchRegion.getLength(); > > // Prevents setting of widget selection with line delimiters at beginning or end >- char startChar= adapter.charAt(widgetPos); >- char endChar= adapter.charAt(widgetPos+length-1); >- boolean borderHasLineDelimiter= startChar == '\n' || startChar == '\r' || endChar == '\n' || endChar == '\r'; >+ boolean borderHasLineDelimiter= false; >+ try { >+ char startChar= adapter.charAt(widgetPos); >+ char endChar= adapter.charAt(widgetPos+length-1); >+ borderHasLineDelimiter= startChar == '\n' || startChar == '\r' || endChar == '\n' || endChar == '\r'; >+ } catch (IndexOutOfBoundsException e) { >+ // Not a problem at beginning or end of document >+ } > boolean redraws= redraws(); > if (borderHasLineDelimiter && redraws) > setRedraw(false);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 80661
: 74662