1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 09:08:10 +01:00

Sorry, stashed changes including:

Change util.range to accept an increment as the third argument.
    Sanitize Makefile.doc
This commit is contained in:
Kris Maglione
2009-01-21 03:41:43 -05:00
parent 050cd4b2e4
commit eb88d7ea0b
9 changed files with 62 additions and 76 deletions

View File

@@ -554,10 +554,10 @@ CompletionContext.prototype = {
{
let self = this;
let items = this.items;
let reverse = start > end;
let step = start > end ? -1 : 1;
start = Math.max(0, start || 0);
end = Math.min(items.length, end ? end : items.length);
return util.map(util.range(start, end, reverse), function (i) items[i]);
return util.map(util.range(start, end, step), function (i) items[i]);
},
getRows: function getRows(start, end, doc)
@@ -565,10 +565,10 @@ CompletionContext.prototype = {
let self = this;
let items = this.items;
let cache = this.cache.rows;
let reverse = start > end;
let step = start > end ? -1 : 1;
start = Math.max(0, start || 0);
end = Math.min(items.length, end != null ? end : items.length);
for (let i in util.range(start, end, reverse))
for (let i in util.range(start, end, step))
yield [i, cache[i] = cache[i] || util.xmlToDom(self.createRow(items[i]), doc)];
},