-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Issue #8557 ("Over 100000 matches" when there are exactly 100000 matches) #9385
Changes from 4 commits
c78541c
5eaaee8
35f7280
d63a124
0c83a92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,13 @@ define(function (require, exports, module) { | |
* @type {boolean} | ||
*/ | ||
SearchModel.prototype.foundMaximum = false; | ||
|
||
|
||
/** | ||
* Whether or not we exceeded the maximum number of results in the search we did. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you removing the existing comment for |
||
* @type {boolean} | ||
*/ | ||
SearchModel.prototype.exceedsMaximum = false; | ||
|
||
/** | ||
* Clears out the model to an empty state. | ||
*/ | ||
|
@@ -112,6 +118,7 @@ define(function (require, exports, module) { | |
this.scope = null; | ||
this.numMatches = 0; | ||
this.foundMaximum = false; | ||
this.exceedsMaximum = false; | ||
this.fireChanged(); | ||
}; | ||
|
||
|
@@ -157,6 +164,13 @@ define(function (require, exports, module) { | |
this.numMatches += resultInfo.matches.length; | ||
if (this.numMatches >= SearchModel.MAX_TOTAL_RESULTS) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jacksonweekes I think we can simply change the logic to |
||
this.foundMaximum = true; | ||
|
||
// Remove final result if there have been over MAX_TOTAL_RESULTS found | ||
if (this.numMatches > SearchModel.MAX_TOTAL_RESULTS) { | ||
this.results[fullpath].matches.pop(); | ||
this.numMatches -= 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jacksonweekes You can restore this line to |
||
this.exceedsMaximum = true; | ||
} | ||
} | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Would you mind to remove
**
at the beginning and end of your comment? I know that our coding conventions for comments do not explicitly mention what can be and can't be in the comments. And I know you want to highlight the issue you want to solve in your comment, but it's better we don't have any comment with different forms of highlighting with extra*
.