1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-23 07:45:47 +01:00

add rough initial implementation of :colorscheme

This commit is contained in:
Doug Kearns
2008-11-01 11:18:37 +00:00
parent fdd2339274
commit 2b3ef469c4
2 changed files with 63 additions and 35 deletions

View File

@@ -362,6 +362,32 @@ const highlight = storage.newObject("highlight", Highlights, false);
liberator.registerObserver("load_commands", function ()
{
commands.add(["colo[rscheme]"],
"Load a color scheme",
function (args)
{
let scheme = args.arguments[0];
if (!io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]))
liberator.echoerr("E185: Cannot find color scheme " + scheme);
},
{
argCount: 1,
completer: function (filter)
{
let rtp = options["runtimepath"].split(",");
let schemes = [];
rtp.forEach(function (path) {
schemes = schemes.concat(
[[c[0].replace(/\.vimp$/, ""), ""] for each (c in completion.file(path + "/colors/", true)[1])]
)
});
return [0, completion.filter(schemes, filter)];
}
});
commands.add(["sty[le]"],
"Add or list user styles",
function (args, special)
@@ -498,3 +524,4 @@ liberator.registerObserver("load_commands", function ()
});
});
// vim: set fdm=marker sw=4 ts=4 et: