Fix tabcomplete sort bug exposed by new v8

This commit is contained in:
Calvin Montgomery 2018-11-12 20:55:49 -08:00
parent a9fac9d6d0
commit f7cc00d16b

View file

@ -119,7 +119,16 @@ CyTube.tabCompleteMethods['Cycle options'] = function (input, position, options,
var matches = options.filter(function (option) {
return option.toLowerCase().indexOf(incomplete) === 0;
}).sort(function (a, b) {
return a.toLowerCase() > b.toLowerCase();
var aLower = a.toLowerCase();
var bLower = b.toLowerCase();
if (aLower > bLower) {
return 1;
} else if (aLower < bLower) {
return -1;
} else {
return 0;
}
});
if (matches.length === 0) {