fix: narrow cache miss recovery behavior

This commit is contained in:
Rasyidan Akbar F. 2026-03-17 09:02:06 +07:00
commit 3533670d92
2 changed files with 12 additions and 8 deletions

View file

@ -200,7 +200,10 @@ pub fn config_path() -> Result<PathBuf, IdxError> {
if let Ok(dir) = std::env::var("XDG_CONFIG_HOME")
&& !dir.is_empty()
{
return Ok(PathBuf::from(dir).join("idx").join("config.toml"));
let path = PathBuf::from(dir);
if path.is_absolute() {
return Ok(path.join("idx").join("config.toml"));
}
}
ProjectDirs::from("", "", "idx")
.map(|d| d.config_dir().join("config.toml"))