diff options
author | MinusGix <MinusGix@gmail.com> | 2019-04-13 01:55:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-13 01:55:35 +0200 |
commit | 1399400c3957302e847ed6bc1d385017fe61e932 (patch) | |
tree | 06e89fd534f4b0a3b635497ae700828e10bcedc5 | |
parent | Merge pull request #58 from MinusGix/patch-3 (diff) | |
download | hackchat-1399400c3957302e847ed6bc1d385017fe61e932.tar.gz hackchat-1399400c3957302e847ed6bc1d385017fe61e932.zip |
Make autocomplete with multiple unused results not insert tab
Diffstat (limited to '')
-rw-r--r-- | client/client.js | 8 |
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) + " "); + } } } |