mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-12 00:35:45 +01:00
Make 'loadplugins' a regexlist.
This commit is contained in:
@@ -739,8 +739,9 @@ const Dactyl = Module("dactyl", {
|
||||
dactyl.assert(dir.isReadable(), "E484: Can't open file " + dir.path);
|
||||
|
||||
dactyl.log("Sourcing plugin directory: " + dir.path + "...", 3);
|
||||
let loadplugins = options.get("loadplugins");
|
||||
dir.readDirectory(true).forEach(function (file) {
|
||||
if (file.isFile() && /\.(js|vimp)$/i.test(file.path) && !(file.path in dactyl.pluginFiles)) {
|
||||
if (file.isFile() && loadplugins.getKey(file.path) && !(file.path in dactyl.pluginFiles)) {
|
||||
try {
|
||||
io.source(file.path, false);
|
||||
dactyl.pluginFiles[file.path] = true;
|
||||
@@ -1287,8 +1288,8 @@ const Dactyl = Module("dactyl", {
|
||||
"string", "intro");
|
||||
|
||||
options.add(["loadplugins", "lpl"],
|
||||
"Load plugin scripts when starting up",
|
||||
"boolean", true);
|
||||
"A regex list that defines which plugins are loaded at startup and via :loadplugins",
|
||||
"regexlist", "\\.(js|vimp)$");
|
||||
|
||||
options.add(["titlestring"],
|
||||
"Change the title of the window",
|
||||
|
||||
@@ -883,15 +883,17 @@
|
||||
<tags>'nolpl' 'lpl'</tags>
|
||||
<tags>'noloadplugins' 'loadplugins'</tags>
|
||||
<spec>'loadplugins' 'lpl'</spec>
|
||||
<type>boolean</type>
|
||||
<default>on</default>
|
||||
<type>regexlist</type>
|
||||
<default>\.(js|vimp)$</default>
|
||||
<description>
|
||||
<p>
|
||||
Load plugin scripts when starting up. When on, yet unloaded plugins
|
||||
are automatically loaded after the <tt><t>&dactyl.name;rc</t></tt> file has been
|
||||
sourced. To load plugins earlier, use the <ex>:loadplugins</ex>
|
||||
command within <tt><t>&dactyl.name;rc</t></tt>.
|
||||
A regular expression list that defines which plugins are loaded at
|
||||
startup and via <ex>:loadplugins</ex>. The first item to match is
|
||||
the one that takes effect. If no items match, the file is not
|
||||
loaded. Setting this to a blank value effectively disables plugin
|
||||
loading. See also <ex>:runtime</ex>.
|
||||
</p>
|
||||
<example><ex>:set loadplugins^=</ex>!<str delim="'">foobar-plugin</str></example>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user