diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-09-20 15:38:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-20 15:38:20 +0200 |
| commit | ce8e3995df9e554250543e1a8d90e2e053e3dbec (patch) | |
| tree | 5c2be78e50d0fac36f118931c5112dee5ef6fe16 /zellij-utils/src/input/plugins.rs | |
| parent | docs(changelog): break multiple panes APIs (diff) | |
| download | sl0ppij-ce8e3995df9e554250543e1a8d90e2e053e3dbec.tar.gz sl0ppij-ce8e3995df9e554250543e1a8d90e2e053e3dbec.tar.xz sl0ppij-ce8e3995df9e554250543e1a8d90e2e053e3dbec.zip | |
feat(config): allow loading background plugins on startup (#3616)
* remove old partial implementation
* feat(plugins): allow loading background plugins on startup
* add e2e test
* update config
* udpate config merging
* style(fmt): rustfmt
Diffstat (limited to 'zellij-utils/src/input/plugins.rs')
| -rw-r--r-- | zellij-utils/src/input/plugins.rs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/zellij-utils/src/input/plugins.rs b/zellij-utils/src/input/plugins.rs index 5a2ac645..a646b386 100644 --- a/zellij-utils/src/input/plugins.rs +++ b/zellij-utils/src/input/plugins.rs @@ -35,8 +35,6 @@ impl PluginAliases { pub struct PluginConfig { /// Path of the plugin, see resolve_wasm_bytes for resolution semantics pub path: PathBuf, - /// Plugin type - pub run: PluginType, /// Allow command execution from plugin pub _allow_exec_host_cmd: bool, /// Original location of the @@ -52,7 +50,6 @@ impl PluginConfig { match &run_plugin.location { RunPluginLocation::File(path) => Some(PluginConfig { path: path.clone(), - run: PluginType::Pane(None), _allow_exec_host_cmd: run_plugin._allow_exec_host_cmd, location: run_plugin.location.clone(), userspace_configuration: run_plugin.configuration.clone(), @@ -69,7 +66,6 @@ impl PluginConfig { { Some(PluginConfig { path: PathBuf::from(&tag), - run: PluginType::Pane(None), _allow_exec_host_cmd: run_plugin._allow_exec_host_cmd, location: RunPluginLocation::parse(&format!("zellij:{}", tag), None) .ok()?, @@ -82,7 +78,6 @@ impl PluginConfig { }, RunPluginLocation::Remote(_) => Some(PluginConfig { path: PathBuf::new(), - run: PluginType::Pane(None), _allow_exec_host_cmd: run_plugin._allow_exec_host_cmd, location: run_plugin.location.clone(), userspace_configuration: run_plugin.configuration.clone(), @@ -187,41 +182,11 @@ impl PluginConfig { return last_err; } - /// Sets the tab index inside of the plugin type of the run field. - pub fn set_tab_index(&mut self, tab_index: usize) { - match self.run { - PluginType::Pane(..) => { - self.run = PluginType::Pane(Some(tab_index)); - }, - PluginType::Headless => {}, - } - } - pub fn is_builtin(&self) -> bool { matches!(self.location, RunPluginLocation::Zellij(_)) } } -/// Type of the plugin. Defaults to Pane. -#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Hash, Eq)] -#[serde(rename_all = "kebab-case")] -pub enum PluginType { - // TODO: A plugin with output that's cloned across every pane in a tab, or across the entire - // application might be useful - // Tab - // Static - /// Starts immediately when Zellij is started and runs without a visible pane - Headless, - /// Runs once per pane declared inside a layout file - Pane(Option<usize>), // tab_index -} - -impl Default for PluginType { - fn default() -> Self { - Self::Pane(None) - } -} - #[derive(Error, Debug, PartialEq)] pub enum PluginsConfigError { #[error("Duplication in plugin tag names is not allowed: '{}'", String::from(.0.clone()))] |
