Skip to content

Commit

Permalink
nfc rename other from internal
Browse files Browse the repository at this point in the history
  • Loading branch information
gnprice committed Dec 7, 2024
1 parent 55390d3 commit c009101
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/model/emoji.dart
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class EmojiStoreImpl with EmojiStore {
/// (Rather vacuous for the moment; this structure will
/// gain more substance in an upcoming commit.)
enum EmojiMatchQuality {
exact, prefix, internal;
exact, prefix, other;

/// The best possible quality of match.
static const best = exact;
Expand Down Expand Up @@ -408,10 +408,10 @@ class EmojiAutocompleteView extends AutocompleteView<EmojiAutocompleteQuery, Emo
ReactionType.unicodeEmoji => false,
};
return switch (result.matchQuality) {
EmojiMatchQuality.exact => throw Error(), // handled above
EmojiMatchQuality.prefix => isPopular ? 1 : isCustomEmoji ? 3 : 4,
EmojiMatchQuality.exact => throw Error(), // handled above
EmojiMatchQuality.prefix => isPopular ? 1 : isCustomEmoji ? 3 : 4,
// TODO word-boundary vs. not
EmojiMatchQuality.internal => isPopular ? 2 : isCustomEmoji ? 5 : 6,
EmojiMatchQuality.other => isPopular ? 2 : isCustomEmoji ? 5 : 6,
};
}

Expand Down Expand Up @@ -462,7 +462,7 @@ class EmojiAutocompleteQuery extends ComposeAutocompleteQuery {
EmojiMatchQuality? _matchName(String emojiName) {
if (emojiName == _adjusted) return EmojiMatchQuality.exact;
if (emojiName.startsWith(_adjusted)) return EmojiMatchQuality.prefix;
if (_nameMatches(emojiName)) return EmojiMatchQuality.internal;
if (_nameMatches(emojiName)) return EmojiMatchQuality.other;
return null;
}

Expand Down

0 comments on commit c009101

Please sign in to comment.