1
0
mirror of https://github.com/hack-chat/main.git synced 2024-03-22 13:20:33 +08:00

Merge pull request #59 from MinusGix/patch-4

Make autocomplete with multiple unused results not insert tab
This commit is contained in:
marzavec 2019-04-12 17:52:42 -07:00 committed by GitHub
commit 75e7e56309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) + " ");
}
}
}