From 1399400c3957302e847ed6bc1d385017fe61e932 Mon Sep 17 00:00:00 2001 From: MinusGix Date: Fri, 12 Apr 2019 18:55:35 -0500 Subject: Make autocomplete with multiple unused results not insert tab --- client/client.js | 8 +++++--- 1 file 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) + " "); + } } } -- cgit v1.2.1