1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-17 07:15:46 +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

@@ -291,16 +291,21 @@ var Highlights = Module("Highlight", {
}, {
commands: function (dactyl, modules) {
const { autocommands, commands, completion, CommandOption, config, io } = modules;
let lastScheme;
commands.add(["colo[rscheme]"],
"Load a color scheme",
function (args) {
let scheme = args[0];
if (lastScheme)
lastScheme.unload();
if (scheme == "default")
highlight.clear();
else
dactyl.assert(modules.io.sourceFromRuntimePath(["colors/" + scheme + "." + config.fileExtension]),
"E185: Cannot find color scheme " + scheme);
else {
lastScheme = modules.io.sourceFromRuntimePath(["colors/" + scheme + "." + config.fileExtension]);
dactyl.assert(lastScheme, "E185: Cannot find color scheme " + scheme);
}
autocommands.trigger("ColorScheme", { name: scheme });
},
{