From a33e6a5ec0a6e2bdb400ea6c4f4ae1db32419f91 Mon Sep 17 00:00:00 2001 From: Scott Feeney Date: Wed, 17 Jul 2013 15:41:34 -0400 Subject: [PATCH] Fix @-mention autocompletes when no @ typed Introduced by my fix to #1418 a few commits back, sorry about that! (imported from commit 9df9cdaf4226012076ccdfe0c062606ca8026b38) --- zephyr/static/js/composebox_typeahead.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/static/js/composebox_typeahead.js b/zephyr/static/js/composebox_typeahead.js index 7f03f4e6db..a8e52197ec 100644 --- a/zephyr/static/js/composebox_typeahead.js +++ b/zephyr/static/js/composebox_typeahead.js @@ -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);