int InternalFindNext(ITextIterator textIterator, int offset, int length) { while (textIterator.MoveAhead(1)) { if (textIterator.Position >= offset + length) { textIterator.Position = offset; } int position = textIterator.Position; if (Match(textIterator.Document, position, !SearchOptions.MatchCase, 0)) { if (!SearchOptions.MatchWholeWord || SearchReplaceUtilities.IsWholeWordAt(textIterator.Document, position, curMatchEndOffset - position)) { if (TextSelection.IsInsideRange(curMatchEndOffset - 1, offset, length)) { textIterator.MoveAhead(curMatchEndOffset - position - 1); return(position); } else { return(-1); } } } } return(-1); }
int InternalFindNext(ITextIterator textIterator) { while (textIterator.MoveAhead(1)) { int position = textIterator.Position; if (Match(textIterator.TextBuffer, position, !SearchOptions.MatchCase, 0)) { if (!SearchOptions.MatchWholeWord || SearchReplaceUtilities.IsWholeWordAt(textIterator.TextBuffer, position, curMatchEndOffset - position)) { textIterator.MoveAhead(curMatchEndOffset - position - 1); return(position); } } } return(-1); }