aboutsummaryrefslogtreecommitdiff
path: root/helix-loader/src
diff options
context:
space:
mode:
authorMichael Davis2024-01-16 19:00:06 +0000
committerBlaž Hrastnik2024-01-18 01:57:53 +0000
commit1bc7aac7805285cea9ef6dc8adcaabf87a18ce67 (patch)
tree5f88e2b7bac582d510505699915ef3a4314fef0b /helix-loader/src
parent1f916e65cff4459698d465b2f4558da1e1bf6e44 (diff)
Use helix-stdx tilde expansion and normalization for HELIX_RUNTIME paths
Previously this wasn't possible since helix-core depends on helix-loader, so helix-loader couldn't use helix-core's path extensions. We use the path normalization/canonicalization for the runtime directory provided by the HELIX_RUNTIME environment variable. This improves a scenario where you set a path containing a tilde. Now that path will be expanded and normalized.
Diffstat (limited to 'helix-loader/src')
-rw-r--r--helix-loader/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs
index 991504fb..f8fac670 100644
--- a/helix-loader/src/lib.rs
+++ b/helix-loader/src/lib.rs
@@ -53,7 +53,8 @@ fn prioritize_runtime_dirs() -> Vec<PathBuf> {
rt_dirs.push(conf_rt_dir);
if let Ok(dir) = std::env::var("HELIX_RUNTIME") {
- rt_dirs.push(dir.into());
+ let dir = path::expand_tilde(dir);
+ rt_dirs.push(path::normalize(dir));
}
// If this variable is set during build time, it will always be included