From 8f308d835a46250335a48bdd2ed9f2340382df64 Mon Sep 17 00:00:00 2001 From: Marko Kungla Date: Sat, 19 Apr 2025 20:41:03 +0300 Subject: [PATCH] Add `zed` to Flatpak config and data directories (#28952) Closes #28944 Release Notes: - linux: Fixed incorrect config directory being used when Zed is installed via Flatpak Signed-off-by: Marko Kungla --- crates/paths/src/paths.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/paths/src/paths.rs b/crates/paths/src/paths.rs index 9f7644ee9b..66ed81b101 100644 --- a/crates/paths/src/paths.rs +++ b/crates/paths/src/paths.rs @@ -74,10 +74,9 @@ pub fn config_dir() -> &'static PathBuf { if let Ok(flatpak_xdg_config) = std::env::var("FLATPAK_XDG_CONFIG_HOME") { flatpak_xdg_config.into() } else { - dirs::config_dir() - .expect("failed to determine XDG_CONFIG_HOME directory") - .join("zed") + dirs::config_dir().expect("failed to determine XDG_CONFIG_HOME directory") } + .join("zed") } else { home_dir().join(".config").join("zed") } @@ -95,10 +94,9 @@ pub fn data_dir() -> &'static PathBuf { if let Ok(flatpak_xdg_data) = std::env::var("FLATPAK_XDG_DATA_HOME") { flatpak_xdg_data.into() } else { - dirs::data_local_dir() - .expect("failed to determine XDG_DATA_HOME directory") - .join("zed") + dirs::data_local_dir().expect("failed to determine XDG_DATA_HOME directory") } + .join("zed") } else if cfg!(target_os = "windows") { dirs::data_local_dir() .expect("failed to determine LocalAppData directory")