aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarzavec <admin@marzavec.com>2019-04-13 02:52:42 +0200
committerGitHub <noreply@github.com>2019-04-13 02:52:42 +0200
commit75e7e56309fa7dd1cdab83fdde985f3ee8b50ee4 (patch)
tree06e89fd534f4b0a3b635497ae700828e10bcedc5
parentMerge pull request #58 from MinusGix/patch-3 (diff)
parentMake autocomplete with multiple unused results not insert tab (diff)
downloadhackchat-75e7e56309fa7dd1cdab83fdde985f3ee8b50ee4.tar.gz
hackchat-75e7e56309fa7dd1cdab83fdde985f3ee8b50ee4.zip
Merge pull request #59 from MinusGix/patch-4
Make autocomplete with multiple unused results not insert tab
-rw-r--r--client/client.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/client/client.js b/client/client.js
index 4f77450..ab766b0 100644
--- a/client/client.js
+++ b/client/client.js
@@ -410,10 +410,12 @@ $('#chatinput').onkeydown = function (e) {
var nicks = onlineUsers.filter(function (nick) {
return nick.toLowerCase().indexOf(stub) == 0
});
-
- if (nicks.length == 1) {
- insertAtCursor(nicks[0].substr(stub.length) + " ");
+
+ if (nicks.length > 0) {
autocompletedNick = true;
+ if (nicks.length == 1) {
+ insertAtCursor(nicks[0].substr(stub.length) + " ");
+ }
}
}