summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2023-11-08 10:36:33 +0100
committerAram Drevekenin <aram@poor.dev>2023-11-08 10:36:33 +0100
commite0f7d8893ad04eb23c0b735b525e3baef57b1dce (patch)
tree37c4e8b5f2f654d47412bc27d8d38535cd612635
parent6b18a6c1b7a9fb7dc7cde5e15baf9863c70ba792 (diff)
fix e2e tests and some cleanups
-rw-r--r--zellij-server/src/plugins/unit/plugin_tests.rs4
-rw-r--r--zellij-server/src/route.rs2
-rw-r--r--zellij-server/src/screen.rs3
-rw-r--r--zellij-utils/src/cli.rs2
-rw-r--r--zellij-utils/src/input/actions.rs6
-rw-r--r--zellij-utils/src/kdl/mod.rs4
-rw-r--r--zellij-utils/src/plugin_api/action.rs7
7 files changed, 8 insertions, 20 deletions
diff --git a/zellij-server/src/plugins/unit/plugin_tests.rs b/zellij-server/src/plugins/unit/plugin_tests.rs
index 35e613bc6..08ac5b832 100644
--- a/zellij-server/src/plugins/unit/plugin_tests.rs
+++ b/zellij-server/src/plugins/unit/plugin_tests.rs
@@ -5398,7 +5398,7 @@ pub fn run_command_plugin_command() {
)]));
background_jobs_thread.join().unwrap(); // this might take a while if the cache is cold
teardown();
- let new_tab_event = received_background_jobs_instructions
+ let new_background_job = received_background_jobs_instructions
.lock()
.unwrap()
.iter()
@@ -5410,7 +5410,7 @@ pub fn run_command_plugin_command() {
}
})
.clone();
- assert_snapshot!(format!("{:#?}", new_tab_event));
+ assert!(format!("{:#?}", new_background_job).contains("user_value_1"));
}
#[test]
diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs
index 45de939eb..cbab1ffac 100644
--- a/zellij-server/src/route.rs
+++ b/zellij-server/src/route.rs
@@ -708,14 +708,12 @@ pub(crate) fn route_action(
Action::LaunchPlugin(
run_plugin,
should_float,
- move_to_focused_tab,
should_open_in_place,
) => {
senders
.send_to_screen(ScreenInstruction::LaunchPlugin(
run_plugin,
should_float,
- move_to_focused_tab,
should_open_in_place,
pane_id,
client_id,
diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs
index 04fc0d719..d89e7eb1d 100644
--- a/zellij-server/src/screen.rs
+++ b/zellij-server/src/screen.rs
@@ -294,7 +294,7 @@ pub enum ScreenInstruction {
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, 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
RenamePane(PaneId, Vec<u8>),
@@ -3411,7 +3411,6 @@ pub(crate) fn screen_thread_main(
ScreenInstruction::LaunchPlugin(
run_plugin,
should_float,
- move_to_focused_tab,
should_open_in_place,
pane_id_to_replace,
client_id,
diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs
index 13049b0c7..cdb3f42f1 100644
--- a/zellij-utils/src/cli.rs
+++ b/zellij-utils/src/cli.rs
@@ -532,8 +532,6 @@ pub enum CliAction {
floating: bool,
#[clap(short, long, value_parser)]
in_place: bool,
- #[clap(short, long, value_parser)]
- move_to_focused_tab: bool,
url: Url,
#[clap(short, long, value_parser)]
configuration: Option<PluginUserConfiguration>,
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs
index 296bfa021..d2ad37437 100644
--- a/zellij-utils/src/input/actions.rs
+++ b/zellij-utils/src/input/actions.rs
@@ -211,8 +211,8 @@ pub enum Action {
MiddleClick(Position),
LaunchOrFocusPlugin(RunPlugin, bool, bool, bool), // bools => should float,
// move_to_focused_tab, should_open_in_place
- LaunchPlugin(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
LeftMouseRelease(Position),
RightMouseRelease(Position),
MiddleMouseRelease(Position),
@@ -545,7 +545,6 @@ impl Action {
url,
floating,
in_place,
- move_to_focused_tab,
configuration,
} => {
let current_dir = get_current_dir();
@@ -559,7 +558,6 @@ impl Action {
Ok(vec![Action::LaunchPlugin(
run_plugin,
floating,
- move_to_focused_tab,
in_place,
)])
},
diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs
index d5d7ce73c..8fce144d3 100644
--- a/zellij-utils/src/kdl/mod.rs
+++ b/zellij-utils/src/kdl/mod.rs
@@ -969,9 +969,6 @@ impl TryFrom<(&KdlNode, &Options)> for Action {
let should_float = command_metadata
.and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "floating"))
.unwrap_or(false);
- let move_to_focused_tab = command_metadata
- .and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "move_to_focused_tab"))
- .unwrap_or(false);
let should_open_in_place = command_metadata
.and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "in_place"))
.unwrap_or(false);
@@ -986,7 +983,6 @@ impl TryFrom<(&KdlNode, &Options)> for Action {
Ok(Action::LaunchPlugin(
run_plugin,
should_float,
- move_to_focused_tab,
should_open_in_place,
))
},
diff --git a/zellij-utils/src/plugin_api/action.rs b/zellij-utils/src/plugin_api/action.rs
index e28a36585..0cd0abc2a 100644
--- a/zellij-utils/src/plugin_api/action.rs
+++ b/zellij-utils/src/plugin_api/action.rs
@@ -428,12 +428,12 @@ impl TryFrom<ProtobufAction> for Action {
configuration,
};
let should_float = payload.should_float;
- let move_to_focused_tab = payload.move_to_focused_tab;
+ let _move_to_focused_tab = payload.move_to_focused_tab; // not actually used in
+ // this action
let should_open_in_place = payload.should_open_in_place;
Ok(Action::LaunchPlugin(
run_plugin,
should_float,
- move_to_focused_tab,
should_open_in_place,
))
},
@@ -1025,7 +1025,6 @@ impl TryFrom<Action> for ProtobufAction {
Action::LaunchPlugin(
run_plugin,
should_float,
- move_to_focused_tab,
should_open_in_place,
) => {
let url: Url = Url::from(&run_plugin.location);
@@ -1035,7 +1034,7 @@ impl TryFrom<Action> for ProtobufAction {
LaunchOrFocusPluginPayload {
plugin_url: url.into(),
should_float,
- move_to_focused_tab,
+ move_to_focused_tab: false,
should_open_in_place,
plugin_configuration: Some(run_plugin.configuration.try_into()?),
},