mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-15 08:07:08 +00:00
Upgrade search-index to v1.40.0, increase MAX_SUGGEST_SIZE to 7
This commit is contained in:
parent
92151225d8
commit
13546e8d08
2 changed files with 10 additions and 8 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
let MAX_SUGGEST_SIZE = 7;
|
||||||
|
|
||||||
function Omnibox() {
|
function Omnibox() {
|
||||||
this.isChrome = navigator.userAgent.indexOf("Chrome") !== -1;
|
this.isChrome = navigator.userAgent.indexOf("Chrome") !== -1;
|
||||||
// Firefox doesn't support tags in search suggestion.
|
// Firefox doesn't support tags in search suggestion.
|
||||||
|
@ -28,11 +30,11 @@ Omnibox.prototype.bootstrap = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.suggestResults.length < 5 && /e\d{2,4}$/ig.test(query)) {
|
if (this.suggestResults.length < MAX_SUGGEST_SIZE && /e\d{2,4}$/ig.test(query)) {
|
||||||
this.appendErrorIndexResult(query, 5 - this.suggestResults.length);
|
this.appendErrorIndexResult(query, MAX_SUGGEST_SIZE - this.suggestResults.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.suggestResults.length < 5) {
|
if (this.suggestResults.length < MAX_SUGGEST_SIZE) {
|
||||||
await this.appendCratesResult(query);
|
await this.appendCratesResult(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue