1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-25 23:05:46 +01:00

Make 'loadplugins' a regexlist.

This commit is contained in:
Kris Maglione
2010-09-23 16:17:48 -04:00
parent 4a1e10badd
commit 29bd0b038a
4 changed files with 14 additions and 10 deletions

View File

@@ -739,8 +739,9 @@ const Dactyl = Module("dactyl", {
dactyl.assert(dir.isReadable(), "E484: Can't open file " + dir.path); dactyl.assert(dir.isReadable(), "E484: Can't open file " + dir.path);
dactyl.log("Sourcing plugin directory: " + dir.path + "...", 3); dactyl.log("Sourcing plugin directory: " + dir.path + "...", 3);
let loadplugins = options.get("loadplugins");
dir.readDirectory(true).forEach(function (file) { 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 { try {
io.source(file.path, false); io.source(file.path, false);
dactyl.pluginFiles[file.path] = true; dactyl.pluginFiles[file.path] = true;
@@ -1287,8 +1288,8 @@ const Dactyl = Module("dactyl", {
"string", "intro"); "string", "intro");
options.add(["loadplugins", "lpl"], options.add(["loadplugins", "lpl"],
"Load plugin scripts when starting up", "A regex list that defines which plugins are loaded at startup and via :loadplugins",
"boolean", true); "regexlist", "\\.(js|vimp)$");
options.add(["titlestring"], options.add(["titlestring"],
"Change the title of the window", "Change the title of the window",

View File

@@ -883,15 +883,17 @@
<tags>'nolpl' 'lpl'</tags> <tags>'nolpl' 'lpl'</tags>
<tags>'noloadplugins' 'loadplugins'</tags> <tags>'noloadplugins' 'loadplugins'</tags>
<spec>'loadplugins' 'lpl'</spec> <spec>'loadplugins' 'lpl'</spec>
<type>boolean</type> <type>regexlist</type>
<default>on</default> <default>\.(js|vimp)$</default>
<description> <description>
<p> <p>
Load plugin scripts when starting up. When on, yet unloaded plugins A regular expression list that defines which plugins are loaded at
are automatically loaded after the <tt><t>&dactyl.name;rc</t></tt> file has been startup and via <ex>:loadplugins</ex>. The first item to match is
sourced. To load plugins earlier, use the <ex>:loadplugins</ex> the one that takes effect. If no items match, the file is not
command within <tt><t>&dactyl.name;rc</t></tt>. loaded. Setting this to a blank value effectively disables plugin
loading. See also <ex>:runtime</ex>.
</p> </p>
<example><ex>:set loadplugins^=</ex>!<str delim="'">foobar-plugin</str></example>
</description> </description>
</item> </item>

View File

@@ -20,6 +20,8 @@
- Supports reverse incremental search. - Supports reverse incremental search.
* IMPORTANT: Plugins are now loaded from the 'plugins/' * IMPORTANT: Plugins are now loaded from the 'plugins/'
directory in 'runtimepath' rather than 'plugin/'. directory in 'runtimepath' rather than 'plugin/'.
* IMPORTANT: 'loadplugins' is not a regexlist option rather than
a boolean.
* IMPORTANT: Single quotes no longer treat \s specially. * IMPORTANT: Single quotes no longer treat \s specially.
I.e., 'fo\o''bar' ≡ fo\o'bar I.e., 'fo\o''bar' ≡ fo\o'bar
* IMPORTANT: 'cdpath' and 'runtimepath' no longer treat ,, * IMPORTANT: 'cdpath' and 'runtimepath' no longer treat ,,

View File

@@ -41,7 +41,6 @@ BUGS:
- The MOW shouldn't close when executing hints and ;F isn't working. - The MOW shouldn't close when executing hints and ;F isn't working.
FEATURES: FEATURES:
9 Make 'loadplugins' a regexlist
9 Add quoting help tag 9 Add quoting help tag
9 JavaScript completer: show function parameter spec 9 JavaScript completer: show function parameter spec
9 Fix the arbitrary distinction between 'hinttags' and 9 Fix the arbitrary distinction between 'hinttags' and