提交 9c1df268 编写于 作者: J Jackson Kearl

Fix #104400: Maxed-out searches gives different results with context lines

上级 57cb7024
......@@ -53,8 +53,7 @@ export class TextSearchManager {
}
const newResultSize = this.resultSize(result);
this.resultCount += newResultSize;
if (newResultSize > 0) {
this.resultCount += newResultSize; if (newResultSize > 0 || !extensionResultIsMatch(result)) {
this.collector!.add(result, folderIdx);
}
}
......@@ -83,10 +82,15 @@ export class TextSearchManager {
}
private resultSize(result: TextSearchResult): number {
const match = <TextSearchMatch>result;
return Array.isArray(match.ranges) ?
match.ranges.length :
1;
if (extensionResultIsMatch(result)) {
return Array.isArray(result.ranges) ?
result.ranges.length :
1;
}
else {
// #104400 context lines shoudn't count towards result count
return 0;
}
}
private trimResultToSize(result: TextSearchMatch, size: number): TextSearchMatch {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册