diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-04 15:31:14 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-04 16:51:10 +0300 |
| commit | 15cab964f3494b77159caaea289e17e1596e0720 (patch) | |
| tree | d9614056c26b0d148771a464fc2eb0f0cabc60a2 /src/app/api/plugins/context.rs | |
| parent | b78a8a5c565e66e7e5ba9a06d9cb7f3a771fc4b0 (diff) | |
feat: emit layout update events for runtime layout changes
Diffstat (limited to 'src/app/api/plugins/context.rs')
| -rw-r--r-- | src/app/api/plugins/context.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/app/api/plugins/context.rs b/src/app/api/plugins/context.rs index e81a74d3..ead5c8e2 100644 --- a/src/app/api/plugins/context.rs +++ b/src/app/api/plugins/context.rs @@ -121,6 +121,17 @@ impl App { context.tab_id = Some(tab_id.clone()); context }), + EventData::LayoutUpdated { layout } => self + .plugin_context_for_tab_id(&layout.tab_id, correlation_id) + .or_else(|| { + self.plugin_context_for_workspace_id(&layout.workspace_id, correlation_id) + }) + .unwrap_or_else(|| { + let mut context = empty_plugin_context(correlation_id); + context.workspace_id = Some(layout.workspace_id.clone()); + context.tab_id = Some(layout.tab_id.clone()); + context + }), EventData::PaneCreated { pane } => { self.plugin_context_for_pane_info(pane, correlation_id) } |
