202
203
private static _doFindMatchesMultiline(model: TextModel, searchRange: Range, searcher: Searcher, captureMatches: boolean, limitResultCount: number): FindMatch[] {
204
>
const deltaOffset = model.getOffsetAt(searchRange.getStartPosition());
textModelSearch.ts
205
>
// We always execute multiline search over the lines joined with \n
206
>
// This makes it that \n will match the EOL for both CRLF and LF models
207
>
// We compensate for offset errors in `_getMultilineMatchRange`
208
>
const text = model.getValueInRange(searchRange, EndOfLinePreference.LF);
209
>
const lfCounter = (model.getEOL() === '\r\n' ? new LineFeedCounter(text) : null);
210
>
211
>
const result: FindMatch[] = [];
212
>
let counter = 0;
213
>
214
>
let m: RegExpExecArray | null;
215
>
searcher.reset(0);
216
>
while ((m = searcher.next(text))) {
217
result[counter++] = createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text, lfCounter, m.index, m[0]), m, captureMatches);
218
if (counter >= limitResultCount) {