mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
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.
This commit is contained in:
parent
1f916e65cf
commit
1bc7aac780
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1114,6 +1114,7 @@ dependencies = [
|
|||||||
"cc",
|
"cc",
|
||||||
"dunce",
|
"dunce",
|
||||||
"etcetera",
|
"etcetera",
|
||||||
|
"helix-stdx",
|
||||||
"libloading",
|
"libloading",
|
||||||
"log",
|
"log",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
@ -15,6 +15,8 @@ name = "hx-loader"
|
|||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
helix-stdx = { path = "../helix-stdx" }
|
||||||
|
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
toml = "0.7"
|
toml = "0.7"
|
||||||
|
@ -53,7 +53,8 @@ fn prioritize_runtime_dirs() -> Vec<PathBuf> {
|
|||||||
rt_dirs.push(conf_rt_dir);
|
rt_dirs.push(conf_rt_dir);
|
||||||
|
|
||||||
if let Ok(dir) = std::env::var("HELIX_RUNTIME") {
|
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
|
// If this variable is set during build time, it will always be included
|
||||||
|
Loading…
Reference in New Issue
Block a user