1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-18 08:35:48 +01:00

Allow \c/\C in regexp options and so forth.

This commit is contained in:
Kris Maglione
2011-03-02 14:43:57 -05:00
parent 0f542bc000
commit 66785a8b5f
9 changed files with 45 additions and 25 deletions

View File

@@ -406,12 +406,14 @@ var Highlights = Module("Highlight", {
completion: function (dactyl, modules) {
const { completion, config, io } = modules;
completion.colorScheme = function colorScheme(context) {
let extRe = RegExp("\\." + config.fileExtension + "$");
context.title = ["Color Scheme", "Runtime Path"];
context.keys = { text: function (f) f.leafName.replace(RegExp("\\." + config.fileExtension + "$"), ""), description: ".parent.path" };
context.keys = { text: function (f) f.leafName.replace(extRe, ""), description: ".parent.path" };
context.completions = array.flatten(
io.getRuntimeDirectories("colors").map(
function (dir) dir.readDirectory().filter(
function (file) RegExp("\\." + config.fileExtension + "$").test(file.leafName))));
function (file) extRe.test(file.leafName))));
};