aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-server/src/plugins
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-server/src/plugins
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-server/src/plugins')
-rw-r--r--zellij-server/src/plugins/mod.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/zellij-server/src/plugins/mod.rs b/zellij-server/src/plugins/mod.rs
index fa1fabce..f1d11377 100644
--- a/zellij-server/src/plugins/mod.rs
+++ b/zellij-server/src/plugins/mod.rs
@@ -152,6 +152,7 @@ pub enum PluginInstruction {
keybinds: Option<Keybinds>,
default_mode: Option<InputMode>,
default_shell: Option<TerminalAction>,
+ was_written_to_disk: bool,
},
FailedToWriteConfigToDisk {
file_path: Option<PathBuf>,
@@ -868,12 +869,19 @@ pub(crate) fn plugin_thread_main(
keybinds,
default_mode,
default_shell,
+ was_written_to_disk,
} => {
- // TODO: notify plugins that this happened so that they can eg. rebind temporary keys that
- // were lost
wasm_bridge
.reconfigure(client_id, keybinds, default_mode, default_shell)
.non_fatal();
+ // TODO: notify plugins that this happened so that they can eg. rebind temporary keys that
+ // were lost
+ if was_written_to_disk {
+ let updates = vec![(None, None, Event::ConfigWasWrittenToDisk)];
+ wasm_bridge
+ .update_plugins(updates, shutdown_send.clone())
+ .non_fatal();
+ }
},
PluginInstruction::FailedToWriteConfigToDisk { file_path } => {
let updates = vec![(