diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 8da9fbca7cc0..9419d1276e76 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -12,7 +12,7 @@ include = ["src/**/*", "README.md"] [features] unicode-lines = ["ropey/unicode_lines"] -integration = [] +integration = ["helix-loader/integration"] [dependencies] helix-loader = { version = "0.6", path = "../helix-loader" } diff --git a/helix-core/src/history.rs b/helix-core/src/history.rs index 6e74689afc3c..4a666fbd4160 100644 --- a/helix-core/src/history.rs +++ b/helix-core/src/history.rs @@ -781,7 +781,7 @@ mod test { fn serde_history(original: String, changes_a: Vec, changes_b: Vec) -> bool { fn create_changes(history: &mut History, doc: &mut Rope, changes: Vec) { for c in changes.into_iter().map(Rope::from) { - let transaction = crate::diff::compare_ropes(&doc, &c); + let transaction = crate::diff::compare_ropes(doc, &c); let state = State { doc: doc.clone(), selection: Selection::point(0), @@ -804,8 +804,8 @@ mod test { let (_, res) = History::deserialize(&mut cursor, file.path()).unwrap(); assert_eq!(history, res); - create_changes(&mut history, &mut original, changes_b); cursor.set_position(0); + create_changes(&mut history, &mut original, changes_b); history .serialize(&mut cursor, file.path(), 0, true) .unwrap(); diff --git a/helix-loader/Cargo.toml b/helix-loader/Cargo.toml index 9225ad1a2235..36f1532d20d4 100644 --- a/helix-loader/Cargo.toml +++ b/helix-loader/Cargo.toml @@ -13,6 +13,9 @@ homepage = "https://helix-editor.com" name = "hx-loader" path = "src/main.rs" +[features] +integration = [] + [dependencies] anyhow = "1" serde = { version = "1.0", features = ["derive"] } diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index 8dc2928adc9f..b61138c837a4 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -70,9 +70,13 @@ pub fn local_config_dirs() -> Vec { } pub fn cache_dir() -> PathBuf { - // TODO: allow env var override - let strategy = choose_base_strategy().expect("Unable to find the config directory!"); - let mut path = strategy.cache_dir(); + let mut path = if cfg!(feature = "integration") { + std::env::temp_dir() + } else { + // TODO: allow env var override + let strategy = choose_base_strategy().expect("Unable to find the config directory!"); + strategy.cache_dir() + }; path.push("helix"); path }