Browse Source

Fixed bug introduced in regex search in last revision.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2490 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
341a8924ca
  1. 10
      src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/SearchStrategy/RegExSearchStrategy.cs

10
src/Main/Base/Project/Src/TextEditor/SearchAndReplace/Engine/SearchStrategy/RegExSearchStrategy.cs

@ -40,7 +40,10 @@ namespace SearchAndReplace
while (textIterator.MoveAhead(1)) { while (textIterator.MoveAhead(1)) {
Match m = regex.Match(document, textIterator.Position); Match m = regex.Match(document, textIterator.Position);
if (m == null || !m.Success) { if (m == null || !m.Success) {
break; while (textIterator.Position < document.Length - 1) {
if (!textIterator.MoveAhead(1))
return null;
}
} else { } else {
int delta = m.Index - textIterator.Position; int delta = m.Index - textIterator.Position;
if (delta <= 0 || textIterator.MoveAhead(delta)) { if (delta <= 0 || textIterator.MoveAhead(delta)) {
@ -61,7 +64,10 @@ namespace SearchAndReplace
while (textIterator.MoveAhead(1) && TextSelection.IsInsideRange(textIterator.Position, offset, length)) { while (textIterator.MoveAhead(1) && TextSelection.IsInsideRange(textIterator.Position, offset, length)) {
Match m = regex.Match(document, textIterator.Position); Match m = regex.Match(document, textIterator.Position);
if (m == null || !m.Success) { if (m == null || !m.Success) {
break; while (textIterator.Position < document.Length - 1) {
if (!textIterator.MoveAhead(1))
return null;
}
} else { } else {
int delta = m.Index - textIterator.Position; int delta = m.Index - textIterator.Position;
if (delta <= 0 || textIterator.MoveAhead(delta)) { if (delta <= 0 || textIterator.MoveAhead(delta)) {

Loading…
Cancel
Save