1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-05 05:14:19 +01:00

Make :ba and :fo generally more consistent and less annoying.

This commit is contained in:
Kris Maglione
2009-07-15 14:31:29 -04:00
parent 379c6a2d71
commit 773814c985
2 changed files with 54 additions and 40 deletions

View File

@@ -133,18 +133,7 @@ function CompletionContext(editor, name, offset) //{{{
* @property {Array} An array of predicates on which to filter the
* results.
*/
this.filters = [function (item) {
let text = Array.concat(item.text);
for (let [i, str] in Iterator(text))
{
if (this.match(String(str)))
{
item.text = String(text[i]);
return true;
}
}
return false;
}];
this.filters = [CompletionContext.Filter.text];
/**
* @property {boolean} Specifies whether this context results must
* match the filter at the beginning of the string.
@@ -225,6 +214,24 @@ CompletionContext.Sort = {
unsorted: null
};
CompletionContext.Filter = {
text: function (item) {
let text = Array.concat(item.text);
for (let [i, str] in Iterator(text))
{
if (this.match(String(str)))
{
item.text = String(text[i]);
return true;
}
}
return false;
},
textDescription: function (item) {
return CompletionContext.Filter.text.call(this, item) || this.match(item.description);
}
};
CompletionContext.prototype = {
// Temporary
/**