1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 13:42:27 +01:00

move array utility methods to util.Array

This commit is contained in:
Doug Kearns
2008-10-19 07:26:17 +00:00
parent ca28d52ed4
commit d14a32afa3
9 changed files with 52 additions and 63 deletions

View File

@@ -624,11 +624,11 @@ function Options() //{{{
switch (opt.operator)
{
case "+":
newValue = util.uniq(Array.concat(opt.optionHas, opt.valueHas), true);
newValue = util.Array.uniq(Array.concat(opt.optionHas, opt.valueHas), true);
break;
case "^":
// NOTE: Vim doesn't prepend if there's a match in the current value
newValue = util.uniq(Array.concat(opt.valueHas, opt.optionHas), true);
newValue = util.Array.uniq(Array.concat(opt.valueHas, opt.optionHas), true);
break;
case "-":
newValue = opt.optionHas.filter(function (item) opt.valueHas.indexOf(item) == -1);
@@ -735,8 +735,7 @@ function Options() //{{{
optionCompletions.push([[prefix + name, option.description]
for each (name in option.names)
if (name.indexOf(filter) == 0)]);
// Flatten array.
optionCompletions = Array.concat.apply(Array, optionCompletions);
optionCompletions = util.Array.flatten(optionCompletions);
return [0, completion.filter(optionCompletions, prefix + filter, true)];
}