mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 16:47:59 +01:00
Replace the *.vimp file extension with config specific extensions.
This commit is contained in:
@@ -80,15 +80,21 @@ const ConfigBase = Class(ModuleBase, {
|
||||
*/
|
||||
features: [],
|
||||
|
||||
/**
|
||||
* @property {string} The file extension used for command script files.
|
||||
* This is the name string sans "dactyl".
|
||||
*/
|
||||
get fileExtension() this.name.slice(0, -6),
|
||||
|
||||
guioptions: {},
|
||||
|
||||
hasTabbrowser: false,
|
||||
|
||||
/**
|
||||
* @property {string} The name of the application that hosts the
|
||||
* “liberated” application. E.g., "Firefox" or "Xulrunner".
|
||||
* extension. E.g., "Firefox" or "XULRunner".
|
||||
*/
|
||||
hostApplication: null,
|
||||
host: null,
|
||||
|
||||
/**
|
||||
* @property {Object} A map between key names for key events should be ignored,
|
||||
@@ -109,7 +115,7 @@ const ConfigBase = Class(ModuleBase, {
|
||||
modes: [],
|
||||
|
||||
/**
|
||||
* @property {string} The name of “liberated” application.
|
||||
* @property {string} The name of the extension.
|
||||
* Required.
|
||||
*/
|
||||
name: null,
|
||||
|
||||
@@ -721,12 +721,12 @@ const Dactyl = Module("dactyl", {
|
||||
return;
|
||||
}
|
||||
|
||||
dactyl.echomsg('Searching for "plugins/**/*.{js,vimp}" in '
|
||||
dactyl.echomsg('Searching for "plugins/**/*.{js,' + config.fileExtension + '}" in '
|
||||
+ [dir.path.replace(/.plugins$/, "") for ([, dir] in Iterator(dirs))]
|
||||
.join(",").quote(), 2);
|
||||
|
||||
dirs.forEach(function (dir) {
|
||||
dactyl.echomsg("Searching for " + (dir.path + "/**/*.{js,vimp}").quote(), 3);
|
||||
dactyl.echomsg("Searching for " + (dir.path + "/**/*.{js," + config.fileExtension + "}").quote(), 3);
|
||||
sourceDirectory(dir);
|
||||
});
|
||||
},
|
||||
@@ -1238,7 +1238,7 @@ const Dactyl = Module("dactyl", {
|
||||
|
||||
options.add(["loadplugins", "lpl"],
|
||||
"A regex list that defines which plugins are loaded at startup and via :loadplugins",
|
||||
"regexlist", "'\\.(js|vimp)$'");
|
||||
"regexlist", "'\\.(js|" + config.fileExtension + ")$'");
|
||||
|
||||
options.add(["titlestring"],
|
||||
"Change the title of the window",
|
||||
|
||||
@@ -86,8 +86,8 @@ const Events = Module("events", {
|
||||
|
||||
for (let file in dir.iterDirectory()) {
|
||||
if (file.exists() && !file.isDirectory() && file.isReadable() &&
|
||||
/^[\w_-]+(\.vimp)?$/i.test(file.leafName)) {
|
||||
let name = file.leafName.replace(/\.vimp$/i, "");
|
||||
RegExp("^[\\w_-]+(\\." + config.fileExtension + ")?$", "i").test(file.leafName)) {
|
||||
let name = file.leafName.replace(RegExp("\\." + config.fileExtension + "$", "i"), "");
|
||||
this._macros.set(name, {
|
||||
keys: file.read().split("\n")[0],
|
||||
timeRecorded: file.lastModifiedTime
|
||||
|
||||
Reference in New Issue
Block a user