1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 19:14:11 +01:00

add help for :colorscheme and move completion function to

completion.colorScheme
This commit is contained in:
Doug Kearns
2008-11-01 14:54:05 +00:00
parent dd7178dfc6
commit 3371398700
8 changed files with 37 additions and 19 deletions

View File

@@ -362,30 +362,21 @@ const highlight = storage.newObject("highlight", Highlights, false);
liberator.registerObserver("load_commands", function ()
{
// TODO: :colo default needs :hi clear
commands.add(["colo[rscheme]"],
"Load a color scheme",
function (args)
{
let scheme = args.arguments[0];
if (!io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]))
if (io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]))
autocommands.trigger("ColorScheme", {});
else
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)];
}
completer: function (filter) completion.colorScheme(filter)
});
commands.add(["sty[le]"],