diff --git a/bundler/src/bundle.rs b/bundler/src/bundle.rs index 992963c..c5e2917 100644 --- a/bundler/src/bundle.rs +++ b/bundler/src/bundle.rs @@ -134,13 +134,19 @@ pub fn bundle<'a>(config: &'a content::Content) -> Bundle<'a> { content::Package::EagerPlugin(p) => { let id = config.id_table.get(p); load_option.plugin_paths.insert(id, p.nix_package.as_str()); - load_option.startup_plugins.push(id); + if !p.startup_config.is_empty() { + load_option.startup_config_plugins.push(id); + } } content::Package::LazyPlugin(p) => { let id = config.id_table.get(p); load_option.plugin_paths.insert(id, p.nix_package.as_str()); + if !p.startup_config.is_empty() { + load_option.startup_config_plugins.push(id); + } + for module in &p.on_modules { load_option .on_modules @@ -180,6 +186,10 @@ pub fn bundle<'a>(config: &'a content::Content) -> Bundle<'a> { content::Package::LazyGroup(g) => { let id = g.name.as_str(); + if !g.startup_config.is_empty() { + load_option.startup_config_plugins.push(id); + } + for module in &g.on_modules { load_option .on_modules @@ -225,8 +235,8 @@ pub fn bundle<'a>(config: &'a content::Content) -> Bundle<'a> { plugins.sort(); plugins.dedup(); } - load_option.startup_plugins.sort(); - load_option.startup_plugins.dedup(); + load_option.startup_config_plugins.sort(); + load_option.startup_config_plugins.dedup(); load_option.timer_clients.sort(); load_option.timer_clients.dedup(); load_option.denops_clients.sort(); diff --git a/bundler/src/bundle/config.rs b/bundler/src/bundle/config.rs index 5993ae3..b91419c 100644 --- a/bundler/src/bundle/config.rs +++ b/bundler/src/bundle/config.rs @@ -15,7 +15,7 @@ pub struct Component<'a> { #[derive(Default)] pub struct LoadOption<'a> { pub plugin_paths: HashMap, PluginPath<'a>>, - pub startup_plugins: Vec<&'a str>, + pub startup_config_plugins: Vec<&'a str>, pub on_modules: HashMap<&'a str, Vec<&'a str>>, pub on_events: HashMap<&'a str, Vec<&'a str>>, pub on_filetypes: HashMap<&'a str, Vec<&'a str>>, diff --git a/bundler/src/bundle/export.rs b/bundler/src/bundle/export.rs index b69451c..b28f66e 100644 --- a/bundler/src/bundle/export.rs +++ b/bundler/src/bundle/export.rs @@ -94,7 +94,7 @@ impl<'a> Exporter for LoadOption<'a> { write!( startup_plugins_file, "return {}", - to_lua_table(&self.startup_plugins) + to_lua_table(&self.startup_config_plugins) )?; // modules