modules.move: slightly prioritize categories that start with the search string
parent
d6793d5c12
commit
82a89b6e86
|
@ -33,6 +33,11 @@ module.exports = bot => {
|
|||
i++;
|
||||
} while (i < normalizedSearchStr.length);
|
||||
|
||||
if (i > 0 && normalizedCatName.startsWith(normalizedSearchStr.slice(0, i))) {
|
||||
// Slightly prioritize categories that *start* with the search string
|
||||
i += 0.5;
|
||||
}
|
||||
|
||||
return [cat, i];
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue