diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-08-07 19:20:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-07 19:20:41 +0200 |
| commit | d44950a5bd15eb3dae6804ea527181204946ee5b (patch) | |
| tree | bfdf5e6c5bc46140e6eca533d8b48f1ae227d2a9 /zellij-utils/src/plugin_api | |
| parent | docs(changelog): floating_panes cwd fix (diff) | |
| download | sl0ppij-d44950a5bd15eb3dae6804ea527181204946ee5b.tar.gz sl0ppij-d44950a5bd15eb3dae6804ea527181204946ee5b.tar.xz sl0ppij-d44950a5bd15eb3dae6804ea527181204946ee5b.zip | |
feat(plugins): rerun_command_pane API (#3546)
* feat(plugins): rerun_command_pane API
* fix tests
Diffstat (limited to 'zellij-utils/src/plugin_api')
| -rw-r--r-- | zellij-utils/src/plugin_api/plugin_command.proto | 6 | ||||
| -rw-r--r-- | zellij-utils/src/plugin_api/plugin_command.rs | 18 |
2 files changed, 21 insertions, 3 deletions
diff --git a/zellij-utils/src/plugin_api/plugin_command.proto b/zellij-utils/src/plugin_api/plugin_command.proto index db25ae6c..d91cc817 100644 --- a/zellij-utils/src/plugin_api/plugin_command.proto +++ b/zellij-utils/src/plugin_api/plugin_command.proto @@ -102,6 +102,7 @@ enum CommandName { HidePaneWithId = 88; ShowPaneWithId = 89; OpenCommandPaneBackground = 90; + RerunCommandPane = 91; } message PluginCommand { @@ -163,9 +164,14 @@ message PluginCommand { HidePaneWithIdPayload hide_pane_with_id_payload = 64; ShowPaneWithIdPayload show_pane_with_id_payload = 65; OpenCommandPanePayload open_command_pane_background_payload = 66; + RerunCommandPanePayload rerun_command_pane_payload = 67; } } +message RerunCommandPanePayload { + uint32 terminal_pane_id = 1; +} + message HidePaneWithIdPayload { PaneId pane_id = 1; } diff --git a/zellij-utils/src/plugin_api/plugin_command.rs b/zellij-utils/src/plugin_api/plugin_command.rs index d07fab62..3df40531 100644 --- a/zellij-utils/src/plugin_api/plugin_command.rs +++ b/zellij-utils/src/plugin_api/plugin_command.rs @@ -11,9 +11,9 @@ pub use super::generated_api::api::{ MovePayload, NewPluginArgs as ProtobufNewPluginArgs, NewTabsWithLayoutInfoPayload, OpenCommandPanePayload, OpenFilePayload, PaneId as ProtobufPaneId, PaneType as ProtobufPaneType, PluginCommand as ProtobufPluginCommand, PluginMessagePayload, - RequestPluginPermissionPayload, ResizePayload, RunCommandPayload, SetTimeoutPayload, - ShowPaneWithIdPayload, SubscribePayload, SwitchSessionPayload, SwitchTabToPayload, - UnsubscribePayload, WebRequestPayload, + RequestPluginPermissionPayload, RerunCommandPanePayload, ResizePayload, RunCommandPayload, + SetTimeoutPayload, ShowPaneWithIdPayload, SubscribePayload, SwitchSessionPayload, + SwitchTabToPayload, UnsubscribePayload, WebRequestPayload, }, plugin_permission::PermissionType as ProtobufPermissionType, resize::ResizeAction as ProtobufResizeAction, @@ -982,6 +982,12 @@ impl TryFrom<ProtobufPluginCommand> for PluginCommand { }, _ => Err("Mismatched payload for OpenCommandPaneBackground"), }, + Some(CommandName::RerunCommandPane) => match protobuf_plugin_command.payload { + Some(Payload::RerunCommandPanePayload(rerun_command_pane_payload)) => Ok( + PluginCommand::RerunCommandPane(rerun_command_pane_payload.terminal_pane_id), + ), + _ => Err("Mismatched payload for RerunCommandPane"), + }, None => Err("Unrecognized plugin command"), } } @@ -1587,6 +1593,12 @@ impl TryFrom<PluginCommand> for ProtobufPluginCommand { )), }) }, + PluginCommand::RerunCommandPane(terminal_pane_id) => Ok(ProtobufPluginCommand { + name: CommandName::RerunCommandPane as i32, + payload: Some(Payload::RerunCommandPanePayload(RerunCommandPanePayload { + terminal_pane_id, + })), + }), } } } |
