refactor(repo): change a bunch of everything
This commit is contained in:
parent
81f367e3aa
commit
81bee82c34
26 changed files with 352 additions and 127 deletions
|
@ -0,0 +1,34 @@
|
|||
From 7973ea6a0e2e94a3b31a4c7b87834d49b7f195bb Mon Sep 17 00:00:00 2001
|
||||
From: Artur Manuel <balkenix@outlook.com>
|
||||
Date: Tue, 11 Feb 2025 16:42:07 +0000
|
||||
Subject: [PATCH] feat(env): add NEOVIDE_CONFIG env var
|
||||
|
||||
---
|
||||
src/settings/config.rs | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/settings/config.rs b/src/settings/config.rs
|
||||
index 705f046..bd8c764 100644
|
||||
--- a/src/settings/config.rs
|
||||
+++ b/src/settings/config.rs
|
||||
@@ -28,9 +28,14 @@ fn neovide_config_dir() -> PathBuf {
|
||||
}
|
||||
|
||||
pub fn config_path() -> PathBuf {
|
||||
- let mut config_path = neovide_config_dir();
|
||||
- config_path.push(CONFIG_FILE);
|
||||
- config_path
|
||||
+ env::var("NEOVIDE_CONFIG")
|
||||
+ .ok()
|
||||
+ .map(PathBuf::from)
|
||||
+ .filter(|path| path.is_file() && path.exists())
|
||||
+ .unwrap_or_else(|| {
|
||||
+ eprintln!("Not a valid config path! Using XDG_CONFIG_HOME.");
|
||||
+ neovide_config_dir().join("config.toml")
|
||||
+ })
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Default, Clone)]
|
||||
--
|
||||
2.47.2
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue