aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test/helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/tests/test/helpers.rs')
-rw-r--r--helix-term/tests/test/helpers.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/helix-term/tests/test/helpers.rs b/helix-term/tests/test/helpers.rs
index ccd07bfa..30fe7d0e 100644
--- a/helix-term/tests/test/helpers.rs
+++ b/helix-term/tests/test/helpers.rs
@@ -1,6 +1,7 @@
use std::{
fs::File,
io::{Read, Write},
+ mem::replace,
path::PathBuf,
time::Duration,
};
@@ -222,10 +223,11 @@ pub fn temp_file_with_contents<S: AsRef<str>>(
/// Generates a config with defaults more suitable for integration tests
pub fn test_config() -> Config {
- merge_keys(Config {
+ Config {
editor: test_editor_config(),
+ keys: helix_term::keymap::default(),
..Default::default()
- })
+ }
}
pub fn test_editor_config() -> helix_view::editor::Config {
@@ -300,8 +302,10 @@ impl AppBuilder {
// Remove this attribute once `with_config` is used in a test:
#[allow(dead_code)]
- pub fn with_config(mut self, config: Config) -> Self {
- self.config = helix_term::keymap::merge_keys(config);
+ pub fn with_config(mut self, mut config: Config) -> Self {
+ let keys = replace(&mut config.keys, helix_term::keymap::default());
+ merge_keys(&mut config.keys, keys);
+ self.config = config;
self
}