aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-tile
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-09-30 18:04:40 +0200
committerGitHub <noreply@github.com>2024-09-30 18:04:40 +0200
commit9f1e38f9fa6efd166f5205eaa8603d6b05a68b2b (patch)
tree3e41bdf65e4bb83fc08f3ad23f913630a97a3d97 /zellij-tile
parentdocs(changelog): background plugins (diff)
downloadsl0ppij-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.rs28
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)]