diff options
Diffstat (limited to 'zellij-server/src/screen.rs')
-rw-r--r-- | zellij-server/src/screen.rs | 92 |
1 files changed, 56 insertions, 36 deletions
diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs index 902351c5d..409a18545 100644 --- a/zellij-server/src/screen.rs +++ b/zellij-server/src/screen.rs @@ -272,11 +272,13 @@ pub enum ScreenInstruction { PreviousSwapLayout(ClientId), NextSwapLayout(ClientId), QueryTabNames(ClientId), - NewTiledPluginPane(RunPlugin, Option<String>, ClientId), // Option<String> is - // optional pane title - NewFloatingPluginPane(RunPlugin, Option<String>, ClientId), // Option<String> is an - NewInPlacePluginPane(RunPlugin, Option<String>, PaneId, ClientId), // Option<String> is an - // optional pane title + NewTiledPluginPane(RunPlugin, Option<String>, bool, ClientId), // Option<String> is + // optional pane title, bool is skip cache + NewFloatingPluginPane(RunPlugin, Option<String>, bool, ClientId), // Option<String> is an + // optional pane title, bool + // is skip cache + NewInPlacePluginPane(RunPlugin, Option<String>, PaneId, bool, ClientId), // Option<String> is an + // optional pane title, bool is skip cache StartOrReloadPluginPane(RunPlugin, Option<String>), AddPlugin( Option<bool>, // should_float @@ -293,10 +295,10 @@ pub enum ScreenInstruction { StartPluginLoadingIndication(u32, LoadingIndication), // u32 - plugin_id ProgressPluginLoadingOffset(u32), // u32 - plugin id RequestStateUpdateForPlugins, - LaunchOrFocusPlugin(RunPlugin, bool, bool, bool, Option<PaneId>, ClientId), // bools are: should_float, move_to_focused_tab, should_open_in_place Option<PaneId> is the pane id to replace - LaunchPlugin(RunPlugin, bool, bool, Option<PaneId>, ClientId), // bools are: should_float, should_open_in_place Option<PaneId> is the pane id to replace - SuppressPane(PaneId, ClientId), // bool is should_float - FocusPaneWithId(PaneId, bool, ClientId), // bool is should_float + LaunchOrFocusPlugin(RunPlugin, bool, bool, bool, Option<PaneId>, bool, ClientId), // bools are: should_float, move_to_focused_tab, should_open_in_place, Option<PaneId> is the pane id to replace, bool following it is skip_cache + LaunchPlugin(RunPlugin, bool, bool, Option<PaneId>, bool, ClientId), // bools are: should_float, should_open_in_place Option<PaneId> is the pane id to replace, bool after is skip_cache + SuppressPane(PaneId, ClientId), // bool is should_float + FocusPaneWithId(PaneId, bool, ClientId), // bool is should_float RenamePane(PaneId, Vec<u8>), RenameTab(usize, Vec<u8>), RequestPluginPermissions( @@ -3145,7 +3147,12 @@ pub(crate) fn screen_thread_main( .senders .send_to_server(ServerInstruction::Log(tab_names, client_id))?; }, - ScreenInstruction::NewTiledPluginPane(run_plugin, pane_title, client_id) => { + ScreenInstruction::NewTiledPluginPane( + run_plugin, + pane_title, + skip_cache, + client_id, + ) => { let tab_index = screen.active_tab_indices.values().next().unwrap_or(&1); let size = Size::default(); let should_float = Some(false); @@ -3162,39 +3169,45 @@ pub(crate) fn screen_thread_main( None, client_id, size, + skip_cache, ))?; }, - ScreenInstruction::NewFloatingPluginPane(run_plugin, pane_title, client_id) => { - match screen.active_tab_indices.values().next() { - Some(tab_index) => { - let size = Size::default(); - let should_float = Some(true); - let should_be_opened_in_place = false; - screen - .bus - .senders - .send_to_pty(PtyInstruction::FillPluginCwd( - should_float, - should_be_opened_in_place, - pane_title, - run_plugin, - *tab_index, - None, - client_id, - size, - ))?; - }, - None => { - log::error!( - "Could not find an active tab - is there at least 1 connected user?" - ); - }, - } + ScreenInstruction::NewFloatingPluginPane( + run_plugin, + pane_title, + skip_cache, + client_id, + ) => match screen.active_tab_indices.values().next() { + Some(tab_index) => { + let size = Size::default(); + let should_float = Some(true); + let should_be_opened_in_place = false; + screen + .bus + .senders + .send_to_pty(PtyInstruction::FillPluginCwd( + should_float, + should_be_opened_in_place, + pane_title, + run_plugin, + *tab_index, + None, + client_id, + size, + skip_cache, + ))?; + }, + None => { + log::error!( + "Could not find an active tab - is there at least 1 connected user?" + ); + }, }, ScreenInstruction::NewInPlacePluginPane( run_plugin, pane_title, pane_id_to_replace, + skip_cache, client_id, ) => match screen.active_tab_indices.values().next() { Some(tab_index) => { @@ -3213,6 +3226,7 @@ pub(crate) fn screen_thread_main( Some(pane_id_to_replace), client_id, size, + skip_cache, ))?; }, None => { @@ -3340,6 +3354,7 @@ pub(crate) fn screen_thread_main( move_to_focused_tab, should_open_in_place, pane_id_to_replace, + skip_cache, client_id, ) => match pane_id_to_replace { Some(pane_id_to_replace) => match screen.active_tab_indices.values().next() { @@ -3357,6 +3372,7 @@ pub(crate) fn screen_thread_main( Some(pane_id_to_replace), client_id, size, + skip_cache, ))?; }, None => { @@ -3400,6 +3416,7 @@ pub(crate) fn screen_thread_main( None, client_id, Size::default(), + skip_cache, ))?; } }, @@ -3414,6 +3431,7 @@ pub(crate) fn screen_thread_main( should_float, should_open_in_place, pane_id_to_replace, + skip_cache, client_id, ) => match pane_id_to_replace { Some(pane_id_to_replace) => match screen.active_tab_indices.values().next() { @@ -3431,6 +3449,7 @@ pub(crate) fn screen_thread_main( Some(pane_id_to_replace), client_id, size, + skip_cache, ))?; }, None => { @@ -3465,6 +3484,7 @@ pub(crate) fn screen_thread_main( None, client_id, Size::default(), + skip_cache, ))?; }, None => { |