summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-03-28 14:58:00 +0100
committerAram Drevekenin <aram@poor.dev>2024-03-28 14:58:00 +0100
commit3fca73e46b8a950c15d27d6c83604e4d054832bc (patch)
treeb30a4a2b2ac3abf12881ef3dee068c21a26d4add
parent2908d2fcefe7c6331a32f99e372fdcda01b7ed3f (diff)
feat(plugins): allow plugins to specify own_url in pipe destinationown_url
-rw-r--r--zellij-server/src/plugins/zellij_exports.rs8
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 {