Fix @-mention autocompletes when no @ typed

Introduced by my fix to #1418 a few commits back, sorry about that!

(imported from commit 9df9cdaf4226012076ccdfe0c062606ca8026b38)
This commit is contained in:
Scott Feeney 2013-07-17 15:41:34 -04:00
parent 3af905db66
commit a33e6a5ec0

View File

@ -276,7 +276,7 @@ exports.initialize = function () {
// Don't autocomplete more than this many characters.
var max_chars = 30;
var last_at = q.lastIndexOf('@');
if (last_at < q.length-1 - max_chars)
if (last_at === -1 || last_at < q.length-1 - max_chars)
return false; // No '@', or too far back
current_token = q.substring(last_at + 1);