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

Use current group to select :style hive. Clear previous colorscheme's styles on :colo.

--HG--
branch : groups
This commit is contained in:
Kris Maglione
2011-02-05 07:30:46 -05:00
parent 5429db5c53
commit 6ee586087a
5 changed files with 53 additions and 29 deletions

View File

@@ -76,11 +76,11 @@ var Contexts = Module("contexts", {
context: null,
groups: Class.memoize(function () Object.create(Group.groupsProto, {
groups: { value: this.groupList.filter(function (g) g.filter(buffer.uri)) }
groups: { value: this.activeGroups().filter(function (g) g.filter(buffer.uri)) }
})),
allGroups: Class.memoize(function () Object.create(Group.groupsProto, {
groups: { value: this.groupList }
groups: { value: this.activeGroups() }
})),
activeGroups: function (subgroup)
@@ -174,7 +174,19 @@ var Contexts = Module("contexts", {
action.toString = function toString() (type === default_ ? "" : type + " ") + rhs;
args = null;
return action;
}
},
GroupFlag: function (name) ({
names: ["-group", "-g"],
description: "Group to which to add",
type: ArgType("group", function (group) isString(group) ? contexts.getGroup(group, name) : group[name]),
get default() (contexts.context && contexts.context.group || contexts.user)[name],
completer: function (context) completion.group(context)
})
}, {
Context: modules.Script = function Context(file, group, args) {
function Const(val) Class.Property({ enumerable: true, value: val });

View File

@@ -508,7 +508,7 @@ var Mappings = Module("mappings", {
names: ["-ex", "-e"],
description: "Execute this mapping as an Ex command rather than keys"
},
groupFlag,
contexts.GroupFlag("mappings"),
{
names: ["-javascript", "-js", "-j"],
description: "Execute this mapping as JavaScript rather than keys"
@@ -587,7 +587,7 @@ var Mappings = Module("mappings", {
{
argCount: "0",
options: [
groupFlag,
contexts.GroupFlag("mappings"),
update({}, modeFlag, {
names: ["-modes", "-mode", "-m"],
type: CommandOption.LIST,
@@ -616,7 +616,7 @@ var Mappings = Module("mappings", {
argCount: "1",
completer: opts.completer,
options: [
groupFlag,
contexts.GroupFlag("mappings"),
update({}, modeFlag, {
names: ["-modes", "-mode", "-m"],
type: CommandOption.LIST,
@@ -627,13 +627,6 @@ var Mappings = Module("mappings", {
});
}
let groupFlag = {
names: ["-group", "-g"],
description: "Mapping group to which to add this mapping",
type: ArgType("map-group", function (group) isString(group) ? contexts.getGroup(group, "mappings") : group),
get default() (contexts.context && contexts.context.group || contexts.user).mappings,
completer: function (context) completion.group(context)
};
let modeFlag = {
names: ["-mode", "-m"],
type: CommandOption.STRING,