mirror of https://github.com/zulip/zulip.git
Don't autocomplete @-mentions mid-word
Now the @ has to follow a space, newline or certain punctuation, or be at the beginning of the message. This addresses the frequent complaint that typing an email address e.g. scott@zulip.com is hard, because after the @, it would try to autocomplete. (imported from commit 043953be3928b0acf2a4ab2b4dd1a80e1a1aa882)
This commit is contained in:
parent
2442edee9e
commit
31bee946be
|
@ -289,6 +289,12 @@ exports.initialize = function () {
|
||||||
return false; // No '@', or too far back
|
return false; // No '@', or too far back
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only match if the @ follows a space, various punctuation,
|
||||||
|
// or is at the beginning of the string.
|
||||||
|
if (last_at > 0 && "\n\t \"'(){}[]".indexOf(q[last_at-1]) === -1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
current_token = q.substring(last_at + 1);
|
current_token = q.substring(last_at + 1);
|
||||||
if (current_token.length < 1 || current_token.lastIndexOf('*') !== -1) {
|
if (current_token.length < 1 || current_token.lastIndexOf('*') !== -1) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue