diff options
| author | Aram Drevekenin <aram@poor.dev> | 2023-11-30 18:10:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-30 18:10:50 +0100 |
| commit | b0f36540fe3cb439fd0981cbb1ef5df6668ddbdf (patch) | |
| tree | 6d1d7329361ad25506cc7e1cb7ea135b9434191b /zellij-utils/src/input | |
| parent | chore(version): bump development version (diff) | |
| download | sl0ppij-b0f36540fe3cb439fd0981cbb1ef5df6668ddbdf.tar.gz sl0ppij-b0f36540fe3cb439fd0981cbb1ef5df6668ddbdf.tar.xz sl0ppij-b0f36540fe3cb439fd0981cbb1ef5df6668ddbdf.zip | |
feat(plugins): skip plugin cache flag (#2971)
* feat(plugins): allow explicitly skipping the plugin cache when loading
* style(fmt): rustfmt
* fix tests
Diffstat (limited to 'zellij-utils/src/input')
| -rw-r--r-- | zellij-utils/src/input/actions.rs | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs index 8fe0a328..8af5d28e 100644 --- a/zellij-utils/src/input/actions.rs +++ b/zellij-utils/src/input/actions.rs @@ -209,10 +209,10 @@ pub enum Action { LeftClick(Position), RightClick(Position), MiddleClick(Position), - LaunchOrFocusPlugin(RunPlugin, bool, bool, bool), // bools => should float, - // move_to_focused_tab, should_open_in_place - LaunchPlugin(RunPlugin, bool, bool), // bools => should float, - // should_open_in_place + LaunchOrFocusPlugin(RunPlugin, bool, bool, bool, bool), // bools => should float, + // move_to_focused_tab, should_open_in_place, skip_cache + LaunchPlugin(RunPlugin, bool, bool, bool), // bools => should float, + // should_open_in_place, skip_cache LeftMouseRelease(Position), RightMouseRelease(Position), MiddleMouseRelease(Position), @@ -238,9 +238,12 @@ pub enum Action { /// Query all tab names QueryTabNames, /// Open a new tiled (embedded, non-floating) plugin pane - NewTiledPluginPane(RunPlugin, Option<String>), // String is an optional name - NewFloatingPluginPane(RunPlugin, Option<String>), // String is an optional name - NewInPlacePluginPane(RunPlugin, Option<String>), // String is an optional name + NewTiledPluginPane(RunPlugin, Option<String>, bool), // String is an optional name, bool is + // skip_cache + NewFloatingPluginPane(RunPlugin, Option<String>, bool), // String is an optional name, bool is + // skip_cache + NewInPlacePluginPane(RunPlugin, Option<String>, bool), // String is an optional name, bool is + // skip_cache StartOrReloadPlugin(RunPlugin), CloseTerminalPane(u32), ClosePluginPane(u32), @@ -310,6 +313,7 @@ impl Action { close_on_exit, start_suspended, configuration, + skip_plugin_cache, } => { let current_dir = get_current_dir(); let cwd = cwd @@ -325,9 +329,17 @@ impl Action { configuration: user_configuration, }; if floating { - Ok(vec![Action::NewFloatingPluginPane(plugin, name)]) + Ok(vec![Action::NewFloatingPluginPane( + plugin, + name, + skip_plugin_cache, + )]) } else if in_place { - Ok(vec![Action::NewInPlacePluginPane(plugin, name)]) + Ok(vec![Action::NewInPlacePluginPane( + plugin, + name, + skip_plugin_cache, + )]) } else { // it is intentional that a new tiled plugin pane cannot include a // direction @@ -337,7 +349,11 @@ impl Action { // is being loaded // this is not the case with terminal panes for historical reasons of // backwards compatibility to a time before we had auto layouts - Ok(vec![Action::NewTiledPluginPane(plugin, name)]) + Ok(vec![Action::NewTiledPluginPane( + plugin, + name, + skip_plugin_cache, + )]) } } else if !command.is_empty() { let mut command = command.clone(); @@ -525,6 +541,7 @@ impl Action { in_place, move_to_focused_tab, configuration, + skip_plugin_cache, } => { let current_dir = get_current_dir(); let run_plugin_location = RunPluginLocation::parse(url.as_str(), Some(current_dir)) @@ -539,6 +556,7 @@ impl Action { floating, move_to_focused_tab, in_place, + skip_plugin_cache, )]) }, CliAction::LaunchPlugin { @@ -546,6 +564,7 @@ impl Action { floating, in_place, configuration, + skip_plugin_cache, } => { let current_dir = get_current_dir(); let run_plugin_location = RunPluginLocation::parse(url.as_str(), Some(current_dir)) @@ -555,7 +574,12 @@ impl Action { _allow_exec_host_cmd: false, configuration: configuration.unwrap_or_default(), }; - Ok(vec![Action::LaunchPlugin(run_plugin, floating, in_place)]) + Ok(vec![Action::LaunchPlugin( + run_plugin, + floating, + in_place, + skip_plugin_cache, + )]) }, CliAction::RenameSession { name } => Ok(vec![Action::RenameSession(name)]), } |
