324
325
constructor(text: string, ranges: ISearchRange | ISearchRange[], previewOptions?: ITextSearchPreviewOptions, webviewIndex?: number) {
326
>
this.webviewIndex = webviewIndex;
search.ts
327
>
328
>
// Trim preview if this is one match and a single-line match with a preview requested.
329
>
// Otherwise send the full text, like for replace or for showing multiple previews.
330
>
// TODO this is fishy.
331
>
const rangesArr = Array.isArray(ranges) ? ranges : [ranges];
332
>
333
>
if (previewOptions && previewOptions.matchLines === 1 && isSingleLineRangeList(rangesArr)) {
334
// 1 line preview requested
335
text = getNLines(text, previewOptions.matchLines);