mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-08 03:14:13 +01:00
Highlighting and stuff.
--HG-- branch : groups
This commit is contained in:
@@ -119,7 +119,7 @@ var AutoCommands = Module("autocommands", {
|
||||
template.map(items, function (item, i)
|
||||
<tr>
|
||||
<td highlight="Title" style="padding-right: 1em;">{i == 0 ? event : ""}</td>
|
||||
<td>{item.filter}</td>
|
||||
<td>{item.filter.toXML ? item.filter.toXML() : item.filter}</td>
|
||||
<td>{item.command}</td>
|
||||
</tr>) +
|
||||
<tr style="height: .5ex;"/>) +
|
||||
|
||||
@@ -36,6 +36,8 @@ var Group = Class("Group", {
|
||||
return update(siteFilter, {
|
||||
toString: function () this.filters.join(","),
|
||||
|
||||
toXML: function () template.map(this.filters, function (f) <span highlight={f(buffer.uri) ? "Filter" : ""}>{f}</span>, <>,</>),
|
||||
|
||||
filters: patterns.map(function (pattern) {
|
||||
let [, res, filter] = /^(!?)(.*)/.exec(pattern);
|
||||
|
||||
@@ -400,9 +402,21 @@ var Contexts = Module("contexts", {
|
||||
completion: function initCompletion() {
|
||||
completion.group = function group(context, active) {
|
||||
context.title = ["Group"];
|
||||
context.keys = { text: "name", description: function (h) h.description || h.filter };
|
||||
let uri = buffer.uri;
|
||||
context.keys = {
|
||||
active: function (group) group.filter(uri),
|
||||
text: "name",
|
||||
description: function (g) <>{g.filter.toXML ? g.filter.toXML() + <> </> : ""}{g.description || ""}</>
|
||||
};
|
||||
context.completions = (active === undefined ? contexts.groupList : contexts.activeGroups(active))
|
||||
.slice(0, -1);
|
||||
|
||||
iter({ Active: true, Inactive: false }).forEach(function ([name, active]) {
|
||||
context.split(name, null, function (context) {
|
||||
context.title[0] = name + " Groups";
|
||||
context.filters.push(function (item) item.active == active);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -417,12 +417,12 @@ var Mappings = Module("mappings", {
|
||||
</tr>
|
||||
<col style="min-width: 6em; padding-right: 1em;"/>
|
||||
{
|
||||
template.map(hives, function (hive) let (i = 0)
|
||||
template.map(hives, function (hive)
|
||||
<tr style="height: .5ex;"/> +
|
||||
template.map(maps(hive), function (map)
|
||||
template.map(map.names, function (name)
|
||||
template.map(map.names, function (name, i)
|
||||
<tr>
|
||||
<td highlight="Title">{!i++ ? hive.name : ""}</td>
|
||||
<td highlight="Title">{!i ? hive.group.name : ""}</td>
|
||||
<td>{modeSign}</td>
|
||||
<td>{name}</td>
|
||||
<td>{map.rhs || map.action.toSource()}</td>
|
||||
|
||||
Reference in New Issue
Block a user