178
*/
179
private static _getMultilineMatchRange(model: TextModel, deltaOffset: number, text: string, lfCounter: LineFeedCounter | null, matchIndex: number, match0: string): Range {
181
>
let lineFeedCountBeforeMatch = 0;
182
>
if (lfCounter) {
183
lineFeedCountBeforeMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex);
184
startOffset = deltaOffset + matchIndex + lineFeedCountBeforeMatch /* add as many \r as there were \n */;
186
startOffset = deltaOffset + matchIndex;
187
}
189
>
let endOffset: number;
190
>
if (lfCounter) {
191
const lineFeedCountBeforeEndOfMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex + match0.length);
192
const lineFeedCountInMatch = lineFeedCountBeforeEndOfMatch - lineFeedCountBeforeMatch;
193
endOffset = startOffset + match0.length + lineFeedCountInMatch /* add as many \r as there were \n */;
195
endOffset = startOffset + match0.length;
196
}
198
>
const startPosition = model.getPositionAt(startOffset);
199
>
const endPosition = model.getPositionAt(endOffset);
200
>
return new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column);
201
>
}
202
203
private static _doFindMatchesMultiline(model: TextModel, searchRange: Range, searcher: Searcher, captureMatches: boolean, limitResultCount: number): FindMatch[] {