Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6650 from SimonBrandner/fix/autocomplete/18593
Browse files Browse the repository at this point in the history
Improve emoji in composer
  • Loading branch information
dbkr authored Aug 23, 2021
2 parents 1fad454 + adc8773 commit 86c21c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/autocomplete/EmojiProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class EmojiProvider extends AutocompleteProvider {
constructor() {
super(EMOJI_REGEX);
this.matcher = new QueryMatcher<ISortedEmoji>(SORTED_EMOJI, {
keys: ['emoji.emoticon'],
keys: [],
funcs: [o => o.emoji.shortcodes.map(s => `:${s}:`)],
// For matching against ascii equivalents
shouldMatchWordsOnly: false,
Expand All @@ -91,7 +91,8 @@ export default class EmojiProvider extends AutocompleteProvider {

let completions = [];
const { command, range } = this.getCurrentCommand(query, selection);
if (command) {

if (command && command[0].length > 2) {
const matchedString = command[0];
completions = this.matcher.match(matchedString, limit);

Expand Down

0 comments on commit 86c21c3

Please sign in to comment.