diff options
author | Aram Drevekenin <aram@poor.dev> | 2024-03-28 14:58:00 +0100 |
---|---|---|
committer | Aram Drevekenin <aram@poor.dev> | 2024-03-28 14:58:00 +0100 |
commit | 3fca73e46b8a950c15d27d6c83604e4d054832bc (patch) | |
tree | b30a4a2b2ac3abf12881ef3dee068c21a26d4add | |
parent | 2908d2fcefe7c6331a32f99e372fdcda01b7ed3f (diff) |
feat(plugins): allow plugins to specify own_url in pipe destinationown_url
-rw-r--r-- | zellij-server/src/plugins/zellij_exports.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/zellij-server/src/plugins/zellij_exports.rs b/zellij-server/src/plugins/zellij_exports.rs index cc0752ff8..935e6ba01 100644 --- a/zellij-server/src/plugins/zellij_exports.rs +++ b/zellij-server/src/plugins/zellij_exports.rs @@ -320,7 +320,13 @@ fn cli_pipe_output(env: &ForeignFunctionEnv, pipe_name: String, output: String) .context("failed to send pipe output") } -fn message_to_plugin(env: &ForeignFunctionEnv, message_to_plugin: MessageToPlugin) -> Result<()> { +fn message_to_plugin( + env: &ForeignFunctionEnv, + mut message_to_plugin: MessageToPlugin, +) -> Result<()> { + if message_to_plugin.plugin_url.as_ref().map(|s| s.as_str()) == Some("zellij:OWN_URL") { + message_to_plugin.plugin_url = Some(env.plugin_env.plugin.location.display()); + } env.plugin_env .senders .send_to_plugin(PluginInstruction::MessageFromPlugin { |