From 5a283759cc02dbdf4ec55188e88f46bb2d8f3102 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Fri, 22 Mar 2013 19:37:35 +0100 Subject: [PATCH] =?UTF-8?q?I=20said=20=E2=80=9CFIX=20#31=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/chat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/chat.js b/code/chat.js index c8584d9f..8bb97598 100644 --- a/code/chat.js +++ b/code/chat.js @@ -26,7 +26,8 @@ window.chat.handleTabCompletion = function() { var posStart = curPos - word.length; var newText = text.substring(0, posStart); - newText += '@' + nick + ' '; + var atPresent = text.substring(posStart-1, posStart) === '@'; + newText += (atPresent ? '' : '@') + nick + ' '; newText += text.substring(curPos); el.val(newText); }