mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 12:52:28 +01:00
Alias c_<C-Tab> to c_<A-f>.
This commit is contained in:
@@ -1609,14 +1609,14 @@ var CommandLine = Module("commandline", {
|
||||
self.completions.onTab(keypressEvents[0]);
|
||||
});
|
||||
|
||||
bind(["<C-Tab>", "<compl-next-group>"], "Select the next matching completion group",
|
||||
bind(["<C-Tab>", "<A-f>", "<compl-next-group>"], "Select the next matching completion group",
|
||||
function ({ keypressEvents, self }) {
|
||||
dactyl.assert(self.completions);
|
||||
self.completions.tabTimer.flush();
|
||||
self.completions.select(self.completions.CTXT_DOWN);
|
||||
});
|
||||
|
||||
bind(["<C-S-Tab>", "<compl-prev-group>"], "Select the previous matching completion group",
|
||||
bind(["<C-S-Tab>", "<A-S-f>", "<compl-prev-group>"], "Select the previous matching completion group",
|
||||
function ({ keypressEvents, self }) {
|
||||
dactyl.assert(self.completions);
|
||||
self.completions.tabTimer.flush();
|
||||
@@ -2128,7 +2128,7 @@ var ItemList = Class("ItemList", {
|
||||
}
|
||||
},
|
||||
|
||||
getRow: function getRow(idx) this.context.getRow(idx),
|
||||
getRow: function getRow(idx) this.context.getRow(idx, this.doc),
|
||||
|
||||
getOffset: function getOffset(idx) this.offsets.start + (idx || 0),
|
||||
|
||||
|
||||
@@ -363,7 +363,7 @@ var Editor = Module("editor", {
|
||||
range.setStart(range.startContainer, range.endOffset - abbrev.lhs.length);
|
||||
this.mungeRange(range, function () abbrev.expand(this.element), true);
|
||||
}
|
||||
},
|
||||
}
|
||||
}, {
|
||||
TextsIterator: Class("TextsIterator", {
|
||||
init: function init(range, context, after) {
|
||||
|
||||
@@ -349,11 +349,15 @@ var CompletionContext = Class("CompletionContext", {
|
||||
* The prototype object for items returned by {@link items}.
|
||||
*/
|
||||
get itemPrototype() {
|
||||
let self = this;
|
||||
let res = { highlight: "" };
|
||||
|
||||
function result(quote) {
|
||||
yield ["context", function () self];
|
||||
yield ["result", quote ? function () quote[0] + util.trapErrors(1, quote, this.text) + quote[2]
|
||||
: function () this.text];
|
||||
};
|
||||
|
||||
for (let i in iter(this.keys, result(this.quote))) {
|
||||
let [k, v] = i;
|
||||
if (typeof v == "string" && /^[.[]/.test(v))
|
||||
@@ -361,7 +365,7 @@ var CompletionContext = Class("CompletionContext", {
|
||||
// reference any variables. Don't bother with eval context.
|
||||
v = Function("i", "return i" + v);
|
||||
if (typeof v == "function")
|
||||
res.__defineGetter__(k, function () Class.replaceProperty(this, k, v.call(this, this.item)));
|
||||
res.__defineGetter__(k, function () Class.replaceProperty(this, k, v.call(this, this.item, self)));
|
||||
else
|
||||
res.__defineGetter__(k, function () Class.replaceProperty(this, k, this.item[v]));
|
||||
res.__defineSetter__(k, function (val) Class.replaceProperty(this, k, val));
|
||||
@@ -636,7 +640,25 @@ var CompletionContext = Class("CompletionContext", {
|
||||
return iter.map(util.range(start, end, step), function (i) items[i]);
|
||||
},
|
||||
|
||||
getRow: function getRow(idx) this.cache.rows && this.cache.rows[idx],
|
||||
getRow: function getRow(idx, doc) {
|
||||
let cache = this.cache.rows;
|
||||
if (cache) {
|
||||
if (!(idx in this.cache.rows))
|
||||
try {
|
||||
cache[idx] = util.xmlToDom(this.createRow(this.items[idx]),
|
||||
doc || this.doc);
|
||||
}
|
||||
catch (e) {
|
||||
util.reportError(e);
|
||||
cache[idx] = util.xmlToDom(
|
||||
<div highlight="CompItem" style="white-space: nowrap">
|
||||
<li highlight="CompResult">{this.text} </li>
|
||||
<li highlight="CompDesc ErrorMsg">{e} </li>
|
||||
</div>, doc || this.doc);
|
||||
}
|
||||
return cache[idx];
|
||||
}
|
||||
},
|
||||
|
||||
getRows: function getRows(start, end, doc) {
|
||||
let self = this;
|
||||
@@ -647,22 +669,9 @@ var CompletionContext = Class("CompletionContext", {
|
||||
start = Math.max(0, start || 0);
|
||||
end = Math.min(items.length, end != null ? end : items.length);
|
||||
|
||||
for (let i in util.range(start, end, step)) {
|
||||
if (!cache[i])
|
||||
try {
|
||||
cache[i] = util.xmlToDom(self.createRow(items[i]), doc);
|
||||
}
|
||||
catch (e) {
|
||||
util.reportError(e);
|
||||
cache[i] = util.xmlToDom(
|
||||
<div highlight="CompItem" style="white-space: nowrap">
|
||||
<li highlight="CompResult">{items[i].text} </li>
|
||||
<li highlight="CompDesc ErrorMsg">{e} </li>
|
||||
</div>, doc);
|
||||
}
|
||||
|
||||
yield [i, cache[i]];
|
||||
}
|
||||
this.doc = doc;
|
||||
for (let i in util.range(start, end, step))
|
||||
yield [i, this.getRow(i)];
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user