Minor tweak to tab complete

This commit is contained in:
calzoneman 2014-02-01 12:42:49 -06:00
parent 2c6edb38b8
commit 9562bc3757
1 changed files with 4 additions and 2 deletions

View File

@ -139,13 +139,15 @@ function chatTabComplete() {
var first = users[0]; var first = users[0];
for (var i = 1; i < users.length; i++) { for (var i = 1; i < users.length; i++) {
if (users[i] !== first) { if (users[i] !== first) {
users[i] = users[i].substring(0, users[i].length - 1);
changed = true; changed = true;
break;
} }
} }
if (changed) { if (changed) {
users[0] = users[0].substring(0, users[0].length - 1); users = users.map(function (name) {
return name.substring(0, name.length - 1);
});
} }
// In the event something above doesn't generate a break condition, limit // In the event something above doesn't generate a break condition, limit