diff options
author | Blaž Hrastnik | 2021-05-10 07:21:55 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-05-10 07:21:55 +0000 |
commit | 1f2d87cb950f165e8a805fc578d7921b48fbdedb (patch) | |
tree | ce2ac182f5b20ccff872ce4e3b92e15203e31c82 /helix-core | |
parent | 37d32e2933448bd100e09b30401d87c60c7eba88 (diff) |
Make the config dir locator work on Windows.
Diffstat (limited to 'helix-core')
-rw-r--r-- | helix-core/Cargo.toml | 2 | ||||
-rw-r--r-- | helix-core/src/lib.rs | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 4e07712b..0bcdac67 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -22,4 +22,4 @@ regex = "1" serde = { version = "1.0", features = ["derive"] } -xdg = "2.0" +etcetera = "0.3" diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index e68dc186..5ce6a63f 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -58,9 +58,11 @@ pub fn runtime_dir() -> std::path::PathBuf { pub fn config_dir() -> std::path::PathBuf { // TODO: allow env var override - let xdg_dirs = - xdg::BaseDirectories::with_prefix("helix").expect("Unable to find XDG directories!"); - xdg_dirs.get_config_home() + use etcetera::base_strategy::{choose_base_strategy, BaseStrategy}; + let strategy = choose_base_strategy().expect("Unable to find the config directory!"); + let mut path = strategy.config_dir(); + path.push("helix"); + path } pub use ropey::{Rope, RopeSlice}; |