emoji: Don't start typeahead for colon-space.

Fixes #9339.
This commit is contained in:
Alena Volkova 2018-05-14 12:26:32 -04:00 committed by Tim Abbott
parent 35577a1f66
commit ba9668470c
2 changed files with 6 additions and 0 deletions

View File

@ -983,10 +983,12 @@ run_test('begins_typeahead', () => {
assert_typeahead_equals(" :", false);
assert_typeahead_equals(":)", false);
assert_typeahead_equals(":4", false);
assert_typeahead_equals(": la", false);
assert_typeahead_equals("test :-P", false);
assert_typeahead_equals("hi emoji :", false);
assert_typeahead_equals("hi emoj:i", false);
assert_typeahead_equals("hi emoji :D", false);
assert_typeahead_equals("hi emoji : t", false);
assert_typeahead_equals("hi emoji :t", emoji_list);
assert_typeahead_equals("hi emoji :ta", emoji_list);
assert_typeahead_equals("hi emoji :da", emoji_list);

View File

@ -351,6 +351,10 @@ exports.compose_content_begins_typeahead = function (query) {
if (/^:-.?$/.test(current_token) || /^:[^a-z+]?$/.test(current_token)) {
return false;
}
// Don't autocomplete if there is a space following a ':'
if (current_token[1] === " ") {
return false;
}
this.completing = 'emoji';
this.token = current_token.substring(1);
return emoji.emojis;