feat(plugins): allow plugins to specify own_url in pipe destination (#3232)

This commit is contained in:
Aram Drevekenin 2024-03-28 15:36:28 +01:00 committed by GitHub
parent 2908d2fcef
commit 9885664fa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {