46
47
export function getTextSearchMatchWithModelContext(matches: ITextSearchMatch[], model: ITextModel, query: ITextSearchQuery): ITextSearchResult[] {
49
>
50
>
let prevLine = -1;
51
>
for (let i = 0; i < matches.length; i++) {
52
>
const { start: matchStartLine, end: matchEndLine } = getMatchStartEnd(matches[i]);
53
>
if (typeof query.surroundingContext === 'number' && query.surroundingContext > 0) {
54
const beforeContextStartLine = Math.max(prevLine + 1, matchStartLine - query.surroundingContext);
55
for (let b = beforeContextStartLine; b < matchStartLine; b++) {