aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/plugin_api
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2025-02-13 17:12:47 +0100
committerGitHub <noreply@github.com>2025-02-13 17:12:47 +0100
commit7aaa7aea8f9a378660492d03ff5736dbf846978d (patch)
tree2b9884e135d73c82da442d1de649eb2b5df3fc54 /zellij-utils/src/plugin_api
parentdocs(changelog): about plugin (diff)
downloadsl0ppij-7aaa7aea8f9a378660492d03ff5736dbf846978d.tar.gz
sl0ppij-7aaa7aea8f9a378660492d03ff5736dbf846978d.tar.xz
sl0ppij-7aaa7aea8f9a378660492d03ff5736dbf846978d.zip
feat(ux): tips on startup (#3988)
* add some tips * refactoring and max tip index * add config to disable release notes and startup tips * allow dismissing startup tips from plugin * random tip at startup * custom launch about * fix tests * style(fmt): rustfmt
Diffstat (limited to 'zellij-utils/src/plugin_api')
-rw-r--r--zellij-utils/src/plugin_api/event.proto1
-rw-r--r--zellij-utils/src/plugin_api/event.rs10
2 files changed, 11 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/event.proto b/zellij-utils/src/plugin_api/event.proto
index f6162b68..b07562e2 100644
--- a/zellij-utils/src/plugin_api/event.proto
+++ b/zellij-utils/src/plugin_api/event.proto
@@ -53,6 +53,7 @@ enum EventType {
HostFolderChanged = 27;
FailedToChangeHostFolder = 28;
PastedText = 29;
+ ConfigWasWrittenToDisk = 30;
}
message EventNameList {
diff --git a/zellij-utils/src/plugin_api/event.rs b/zellij-utils/src/plugin_api/event.rs
index 0f570aee..495060a6 100644
--- a/zellij-utils/src/plugin_api/event.rs
+++ b/zellij-utils/src/plugin_api/event.rs
@@ -355,6 +355,10 @@ impl TryFrom<ProtobufEvent> for Event {
},
_ => Err("Malformed payload for the PastedText Event"),
},
+ Some(ProtobufEventType::ConfigWasWrittenToDisk) => match protobuf_event.payload {
+ None => Ok(Event::ConfigWasWrittenToDisk),
+ _ => Err("Malformed payload for the ConfigWasWrittenToDisk Event"),
+ },
None => Err("Unknown Protobuf Event"),
}
}
@@ -725,6 +729,10 @@ impl TryFrom<Event> for ProtobufEvent {
pasted_text,
})),
}),
+ Event::ConfigWasWrittenToDisk => Ok(ProtobufEvent {
+ name: ProtobufEventType::ConfigWasWrittenToDisk as i32,
+ payload: None,
+ }),
}
}
}
@@ -1306,6 +1314,7 @@ impl TryFrom<ProtobufEventType> for EventType {
ProtobufEventType::HostFolderChanged => EventType::HostFolderChanged,
ProtobufEventType::FailedToChangeHostFolder => EventType::FailedToChangeHostFolder,
ProtobufEventType::PastedText => EventType::PastedText,
+ ProtobufEventType::ConfigWasWrittenToDisk => EventType::ConfigWasWrittenToDisk,
})
}
}
@@ -1344,6 +1353,7 @@ impl TryFrom<EventType> for ProtobufEventType {
EventType::HostFolderChanged => ProtobufEventType::HostFolderChanged,
EventType::FailedToChangeHostFolder => ProtobufEventType::FailedToChangeHostFolder,
EventType::PastedText => ProtobufEventType::PastedText,
+ EventType::ConfigWasWrittenToDisk => ProtobufEventType::ConfigWasWrittenToDisk,
})
}
}