diff options
author | Pascal Kuthe | 2023-01-30 23:31:21 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2023-03-29 03:57:30 +0000 |
commit | 2d10a429ebf7abe5af184b6227346377dc0523e8 (patch) | |
tree | 114b19f0031fc001d7798a31372675a94623262f /helix-term/tests/test/helpers.rs | |
parent | d59b80514e15d26f280a9b0dbd18afac08578638 (diff) |
add workspace config and manual LSP root management
fixup documentation
Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com>
fixup typo
Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com>
Diffstat (limited to 'helix-term/tests/test/helpers.rs')
-rw-r--r-- | helix-term/tests/test/helpers.rs | 12 |
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 } |