From 1f2d87cb950f165e8a805fc578d7921b48fbdedb Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 10 May 2021 16:21:55 +0900 Subject: Make the config dir locator work on Windows. --- helix-core/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'helix-core/src') 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}; -- cgit v1.2.3-70-g09d2