This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c78541c
Issue #8557- fixed to show correct result count
jacksonweekes 5eaaee8
Removed unused reference to SearchModel
jacksonweekes 35f7280
Add comment back to clear() function
jacksonweekes d63a124
Changed -- to conform to JSLint
jacksonweekes 0c83a92
Conform code to conventions
jacksonweekes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,10 +99,13 @@ define(function (require, exports, module) { | |
* @type {boolean} | ||
*/ | ||
SearchModel.prototype.foundMaximum = false; | ||
|
||
/** | ||
* Clears out the model to an empty state. | ||
* 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; | ||
|
||
SearchModel.prototype.clear = function () { | ||
this.results = {}; | ||
this.queryInfo = null; | ||
|
@@ -112,6 +115,7 @@ define(function (require, exports, module) { | |
this.scope = null; | ||
this.numMatches = 0; | ||
this.foundMaximum = false; | ||
this.exceedsMaximum = false; | ||
this.fireChanged(); | ||
}; | ||
|
||
|
@@ -157,6 +161,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--; | ||
this.exceedsMaximum = true; | ||
} | ||
} | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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*
.