aboutsummaryrefslogtreecommitdiffstats
path: root/auto_source.js
diff options
context:
space:
mode:
authoranekos2010-04-12 17:34:16 +0000
committeranekos2010-04-12 17:34:16 +0000
commitfd61b8763337e6c29b06074dbbf7173e8aa65727 (patch)
treeb5bcdabc608d4964ebd26df8910f93cd7b82efd7 /auto_source.js
parent81da597f0c189a7311c2c4422e0950e5d8a85d2a (diff)
downloadvimperator-plugins-fd61b8763337e6c29b06074dbbf7173e8aa65727.tar.bz2
source 時に context を考慮するようにした
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37206 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'auto_source.js')
-rw-r--r--auto_source.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/auto_source.js b/auto_source.js
index 5ffb25f..ae15609 100644
--- a/auto_source.js
+++ b/auto_source.js
@@ -133,6 +133,19 @@ let INFO =
return normalize(cur.path);
}
+ function source (filepath) {
+ io.source(filepath);
+ let ctx = liberator.plugins.contexts[filepath];
+ liberator.log(filepath);
+ if (ctx) {
+ liberator.log(ctx.NAME);
+ if (typeof liberator.plugins[ctx.NAME] === 'undefined')
+ liberator.plugins[ctx.NAME] = ctx;
+ } else {
+ liberator.echoerr('plugin_loader.js: context not found (' + filepath + ')');
+ }
+ }
+
function startWatching (filepath, command, force, initHelp) {
if (exists(filepath)) {
if (force) {
@@ -153,7 +166,7 @@ let INFO =
if (last != current) {
liberator.log('sourcing: ' + filepath);
last = current;
- io.source(filepath);
+ source(filepath);
if (command) {
liberator.log('command execute: ' + command);
liberator.execute(command);