diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-06-14 17:11:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-14 17:11:02 +0200 |
| commit | 1f0ae94f01647eab66cabbd11434ecae1fac8da3 (patch) | |
| tree | b568f9ffc2064f4bdfd9c02c0aa5e581a3d1e750 /zellij-utils/src/plugin_api/plugin_command.rs | |
| parent | docs(readme): add name origin section (#3391) (diff) | |
| download | sl0ppij-1f0ae94f01647eab66cabbd11434ecae1fac8da3.tar.gz sl0ppij-1f0ae94f01647eab66cabbd11434ecae1fac8da3.tar.xz sl0ppij-1f0ae94f01647eab66cabbd11434ecae1fac8da3.zip | |
feat(plugins): rebind keys at runtime (#3422)
* refactor(server): interpret keys on server so they can be rebound
* feat(plugins): allow rebinding keys at runtime
* various cleanups
* add tests
* style(fmt): rustfmt
* fix(tests): address (some) e2e test flakiness
* style(fmt): rustfmt
Diffstat (limited to 'zellij-utils/src/plugin_api/plugin_command.rs')
| -rw-r--r-- | zellij-utils/src/plugin_api/plugin_command.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/plugin_command.rs b/zellij-utils/src/plugin_api/plugin_command.rs index 771b6151..aeafc1d4 100644 --- a/zellij-utils/src/plugin_api/plugin_command.rs +++ b/zellij-utils/src/plugin_api/plugin_command.rs @@ -888,6 +888,12 @@ impl TryFrom<ProtobufPluginCommand> for PluginCommand { }, _ => Err("Mismatched payload for NewTabsWithLayoutInfo"), }, + Some(CommandName::RebindKeys) => match protobuf_plugin_command.payload { + Some(Payload::RebindKeysPayload(rebind_keys_payload)) => { + Ok(PluginCommand::RebindKeys(rebind_keys_payload)) + }, + _ => Err("Mismatched payload for RebindKeys"), + }, None => Err("Unrecognized plugin command"), } } @@ -1420,6 +1426,10 @@ impl TryFrom<PluginCommand> for ProtobufPluginCommand { )), }) }, + PluginCommand::RebindKeys(rebind_keys_payload) => Ok(ProtobufPluginCommand { + name: CommandName::RebindKeys as i32, + payload: Some(Payload::RebindKeysPayload(rebind_keys_payload)), + }), } } } |
