diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-07-17 16:08:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-17 16:08:31 +0200 |
| commit | 84ff29dd024c73e94f3e65d56d907ae903fe3752 (patch) | |
| tree | b3f01370b3b1af71f018eeb27a1437b75e959721 /zellij-server/src/plugins/unit | |
| parent | docs(changelog): scroll region fix (diff) | |
| download | sl0ppij-84ff29dd024c73e94f3e65d56d907ae903fe3752.tar.gz sl0ppij-84ff29dd024c73e94f3e65d56d907ae903fe3752.tar.xz sl0ppij-84ff29dd024c73e94f3e65d56d907ae903fe3752.zip | |
feat(ui): configuration screen + configure non-colliding keys at runtime (#3502)
* rebind => reconfigure
* persist keybinds and mode info to new tabs
* add configuration plugin
* make tests pass
* remove warnings
* style(fmt): rustfmt
Diffstat (limited to 'zellij-server/src/plugins/unit')
4 files changed, 20 insertions, 9 deletions
diff --git a/zellij-server/src/plugins/unit/plugin_tests.rs b/zellij-server/src/plugins/unit/plugin_tests.rs index c1f4fcd5..5ef220db 100644 --- a/zellij-server/src/plugins/unit/plugin_tests.rs +++ b/zellij-server/src/plugins/unit/plugin_tests.rs @@ -6492,7 +6492,7 @@ pub fn disconnect_other_clients_plugins_command() { #[test] #[ignore] -pub fn rebind_keys_plugin_command() { +pub fn reconfigure_plugin_command() { let temp_folder = tempdir().unwrap(); // placed explicitly in the test scope because its // destructor removes the directory let plugin_host_folder = PathBuf::from(temp_folder.path()); @@ -6527,7 +6527,7 @@ pub fn rebind_keys_plugin_command() { let received_server_instruction = Arc::new(Mutex::new(vec![])); let server_thread = log_actions_in_thread!( received_server_instruction, - ServerInstruction::RebindKeys, + ServerInstruction::Reconfigure, server_receiver, 1 ); @@ -6555,20 +6555,20 @@ pub fn rebind_keys_plugin_command() { std::thread::sleep(std::time::Duration::from_millis(500)); teardown(); server_thread.join().unwrap(); // this might take a while if the cache is cold - let rebind_keys_event = received_server_instruction + let reconfigure_event = received_server_instruction .lock() .unwrap() .iter() .rev() .find_map(|i| { - if let ServerInstruction::RebindKeys(..) = i { + if let ServerInstruction::Reconfigure(..) = i { Some(i.clone()) } else { None } }) .clone(); - assert_snapshot!(format!("{:#?}", rebind_keys_event)); + assert_snapshot!(format!("{:#?}", reconfigure_event)); } #[test] diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__granted_permission_request_result.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__granted_permission_request_result.snap index 465f1088..28c7dedc 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__granted_permission_request_result.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__granted_permission_request_result.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/plugins/./unit/plugin_tests.rs -assertion_line: 5500 +assertion_line: 5505 expression: "format!(\"{:#?}\", permissions)" --- Some( @@ -14,6 +14,6 @@ Some( WebAccess, ReadCliPipes, MessageAndLaunchOtherPlugins, - RebindKeys, + Reconfigure, ], ) diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__reconfigure_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__reconfigure_plugin_command.snap new file mode 100644 index 00000000..3f788d7d --- /dev/null +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__reconfigure_plugin_command.snap @@ -0,0 +1,11 @@ +--- +source: zellij-server/src/plugins/./unit/plugin_tests.rs +assertion_line: 6571 +expression: "format!(\"{:#?}\", reconfigure_event)" +--- +Some( + Reconfigure( + 1, + "\n keybinds {\n locked {\n bind \"a\" { NewTab; }\n }\n }\n ", + ), +) diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__request_plugin_permissions.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__request_plugin_permissions.snap index a0fec410..75f47da7 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__request_plugin_permissions.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__request_plugin_permissions.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/plugins/./unit/plugin_tests.rs -assertion_line: 5409 +assertion_line: 5414 expression: "format!(\"{:#?}\", new_tab_event)" --- Some( @@ -16,6 +16,6 @@ Some( WebAccess, ReadCliPipes, MessageAndLaunchOtherPlugins, - RebindKeys, + Reconfigure, ], ) |
