diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-09-30 18:04:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-30 18:04:40 +0200 |
| commit | 9f1e38f9fa6efd166f5205eaa8603d6b05a68b2b (patch) | |
| tree | 3e41bdf65e4bb83fc08f3ad23f913630a97a3d97 /zellij-tile | |
| parent | docs(changelog): background plugins (diff) | |
| download | sl0ppij-9f1e38f9fa6efd166f5205eaa8603d6b05a68b2b.tar.gz sl0ppij-9f1e38f9fa6efd166f5205eaa8603d6b05a68b2b.tar.xz sl0ppij-9f1e38f9fa6efd166f5205eaa8603d6b05a68b2b.zip | |
feat(ui): built-in plugin manager (#3633)
* add plugin list to session info
* feat(plugins): new_plugin and reload_plugin API commands
* feat(plugins): built-in plugin manager
* style(fmt): rustfmt
* update plugins
Diffstat (limited to 'zellij-tile')
| -rw-r--r-- | zellij-tile/src/shim.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/zellij-tile/src/shim.rs b/zellij-tile/src/shim.rs index 268e10f2..8ede34c4 100644 --- a/zellij-tile/src/shim.rs +++ b/zellij-tile/src/shim.rs @@ -1062,6 +1062,34 @@ pub fn break_panes_to_tab_with_index( unsafe { host_run_plugin_command() }; } +/// Reload an already-running in this session, optionally skipping the cache +pub fn reload_plugin_with_id(plugin_id: u32) { + let plugin_command = PluginCommand::ReloadPlugin(plugin_id); + let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap(); + object_to_stdout(&protobuf_plugin_command.encode_to_vec()); + unsafe { host_run_plugin_command() }; +} + +/// Reload an already-running in this session, optionally skipping the cache +pub fn load_new_plugin<S: AsRef<str>>( + url: S, + config: BTreeMap<String, String>, + load_in_background: bool, + skip_plugin_cache: bool, +) where + S: ToString, +{ + let plugin_command = PluginCommand::LoadNewPlugin { + url: url.to_string(), + config, + load_in_background, + skip_plugin_cache, + }; + let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap(); + object_to_stdout(&protobuf_plugin_command.encode_to_vec()); + unsafe { host_run_plugin_command() }; +} + // Utility Functions #[allow(unused)] |
