diff options
| author | Aram Drevekenin <aram@poor.dev> | 2025-06-03 17:15:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-03 17:15:32 +0200 |
| commit | a9f8bbcd197c8d14832fc1ab1fbe4d4111a2014d (patch) | |
| tree | 6d354fdd36cf534d73e0cb81a7cacd3fedc1ebb9 /zellij-utils/src/plugin_api/event.rs | |
| parent | docs(changelog): theme fixes (diff) | |
| download | sl0ppij-a9f8bbcd197c8d14832fc1ab1fbe4d4111a2014d.tar.gz sl0ppij-a9f8bbcd197c8d14832fc1ab1fbe4d4111a2014d.tar.xz sl0ppij-a9f8bbcd197c8d14832fc1ab1fbe4d4111a2014d.zip | |
feat(ux): improve multiple select (#4221)
* intercept/clear-intercept key APIs
* allow opening a pinned unfocused floating pane
* rework plugin
* improve some apis
* fix tests
* tests for pane groups
* more exact placement and tests
* plugin command permission and cleanup
* improve some multiselect ux
* improve plugin ui
* remove old status indicator
* allow moving plugin out of the way
* style(fmt): rustfmt
* update plugins
* remove old keybinding
* cleanups
* fix: only rename pane if needed
* changelog and some cleanups
* style(fmt): rustfmt
Diffstat (limited to 'zellij-utils/src/plugin_api/event.rs')
| -rw-r--r-- | zellij-utils/src/plugin_api/event.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/event.rs b/zellij-utils/src/plugin_api/event.rs index 88c55827..a853e12d 100644 --- a/zellij-utils/src/plugin_api/event.rs +++ b/zellij-utils/src/plugin_api/event.rs @@ -363,6 +363,12 @@ impl TryFrom<ProtobufEvent> for Event { None => Ok(Event::BeforeClose), _ => Err("Malformed payload for the BeforeClose Event"), }, + Some(ProtobufEventType::InterceptedKeyPress) => match protobuf_event.payload { + Some(ProtobufEventPayload::KeyPayload(protobuf_key)) => { + Ok(Event::InterceptedKeyPress(protobuf_key.try_into()?)) + }, + _ => Err("Malformed payload for the InterceptedKeyPress Event"), + }, None => Err("Unknown Protobuf Event"), } } @@ -741,6 +747,10 @@ impl TryFrom<Event> for ProtobufEvent { name: ProtobufEventType::BeforeClose as i32, payload: None, }), + Event::InterceptedKeyPress(key) => Ok(ProtobufEvent { + name: ProtobufEventType::InterceptedKeyPress as i32, + payload: Some(event::Payload::KeyPayload(key.try_into()?)), + }), } } } @@ -1376,6 +1386,7 @@ impl TryFrom<ProtobufEventType> for EventType { ProtobufEventType::PastedText => EventType::PastedText, ProtobufEventType::ConfigWasWrittenToDisk => EventType::ConfigWasWrittenToDisk, ProtobufEventType::BeforeClose => EventType::BeforeClose, + ProtobufEventType::InterceptedKeyPress => EventType::InterceptedKeyPress, }) } } @@ -1416,6 +1427,7 @@ impl TryFrom<EventType> for ProtobufEventType { EventType::PastedText => ProtobufEventType::PastedText, EventType::ConfigWasWrittenToDisk => ProtobufEventType::ConfigWasWrittenToDisk, EventType::BeforeClose => ProtobufEventType::BeforeClose, + EventType::InterceptedKeyPress => ProtobufEventType::InterceptedKeyPress, }) } } |
