mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-25 03:58:30 +00:00
Fix autocomplete not showing all emotes
This commit is contained in:
parent
c4b16a4910
commit
41fd377f48
1 changed files with 7 additions and 3 deletions
|
@ -19,9 +19,10 @@ const localeCaseInsensitive = Intl.Collator(undefined, {sensitivity: 'accent'});
|
||||||
// Describes how an emote matches against a given input
|
// Describes how an emote matches against a given input
|
||||||
// Higher values represent a more exact match
|
// Higher values represent a more exact match
|
||||||
const NO_MATCH = 0;
|
const NO_MATCH = 0;
|
||||||
const NON_PREFIX_MATCH = 1;
|
const CASE_INSENSITIVE_NON_PREFIX_MATCH = 1;
|
||||||
const CASE_INSENSITIVE_PREFIX_MATCH = 2;
|
const NON_PREFIX_MATCH = 2;
|
||||||
const EXACT_PREFIX_MATCH = 3;
|
const CASE_INSENSITIVE_PREFIX_MATCH = 3;
|
||||||
|
const EXACT_PREFIX_MATCH = 4;
|
||||||
|
|
||||||
function getNodeText(node) {
|
function getNodeText(node) {
|
||||||
if ( ! node )
|
if ( ! node )
|
||||||
|
@ -870,6 +871,9 @@ export default class Input extends Module {
|
||||||
if (idx !== -1 && emote_lower.slice(idx + 1).startsWith(term_lower.slice(1)))
|
if (idx !== -1 && emote_lower.slice(idx + 1).startsWith(term_lower.slice(1)))
|
||||||
return NON_PREFIX_MATCH;
|
return NON_PREFIX_MATCH;
|
||||||
|
|
||||||
|
if (emote_lower.includes(term_lower))
|
||||||
|
return CASE_INSENSITIVE_NON_PREFIX_MATCH;
|
||||||
|
|
||||||
return NO_MATCH;
|
return NO_MATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue