1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 09:42:28 +01:00

Replace the *.vimp file extension with config specific extensions.

This commit is contained in:
Doug Kearns
2010-10-01 02:43:02 +10:00
parent 002522c179
commit 725cf1f1f7
12 changed files with 29 additions and 18 deletions

View File

@@ -238,7 +238,7 @@ const Highlights = Module("Highlight", {
if (scheme == "default")
highlight.clear();
else
dactyl.assert(modules.io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]),
dactyl.assert(modules.io.sourceFromRuntimePath(["colors/" + scheme + "." + modules.config.fileExtension]),
"E185: Cannot find color scheme " + scheme);
modules.autocommands.trigger("ColorScheme", { name: scheme });
},
@@ -313,13 +313,14 @@ const Highlights = Module("Highlight", {
},
completion: function (dactyl, modules) {
const completion = modules.completion;
const config = modules.config;
completion.colorScheme = function colorScheme(context) {
context.title = ["Color Scheme", "Runtime Path"];
context.keys = { text: function (f) f.leafName.replace(/\.vimp$/, ""), description: ".parent.path" };
context.keys = { text: function (f) f.leafName.replace(RegExp("\\." + config.fileExtension + "$"), ""), description: ".parent.path" };
context.completions = array.flatten(
modules.io.getRuntimeDirectories("colors").map(
function (dir) dir.readDirectory().filter(
function (file) /\.vimp$/.test(file.leafName))));
function (file) RegExp("\\." + config.fileExtension + "$").test(file.leafName))));
};