Fix tabcomplete sort bug exposed by new v8
This commit is contained in:
parent
a9fac9d6d0
commit
f7cc00d16b
|
@ -119,7 +119,16 @@ CyTube.tabCompleteMethods['Cycle options'] = function (input, position, options,
|
||||||
var matches = options.filter(function (option) {
|
var matches = options.filter(function (option) {
|
||||||
return option.toLowerCase().indexOf(incomplete) === 0;
|
return option.toLowerCase().indexOf(incomplete) === 0;
|
||||||
}).sort(function (a, b) {
|
}).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) {
|
if (matches.length === 0) {
|
||||||
|
|
Loading…
Reference in a new issue