diff --git a/docs/config_file_example.yaml b/docs/config_file_example.yaml index 0bda02f..dcf904d 100644 --- a/docs/config_file_example.yaml +++ b/docs/config_file_example.yaml @@ -19,7 +19,10 @@ finder: # overrides_var: --tac # equivalent to the --fzf-overrides-var option # cheats: - # path: /path/to/some/dir # equivalent to the --path option + # paths: + # - /path/to/some/dir + # - /path/to/another/dir + # path: /path/to/some/dir # (DEPRECATED) equivalent to the --path option # search: # tags: git,!checkout # equivalent to the --tag-rules option diff --git a/src/config/mod.rs b/src/config/mod.rs index d15ab0d..30ed144 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -55,6 +55,14 @@ impl Config { .path .clone() .or_else(|| self.env.path.clone()) + .or_else(|| { + let p = self.yaml.cheats.paths.clone(); + if p.is_empty() { + None + } else { + Some(p.join(":")) + } + }) .or_else(|| self.yaml.cheats.path.clone()) } diff --git a/src/config/yaml.rs b/src/config/yaml.rs index 41f821e..89519aa 100644 --- a/src/config/yaml.rs +++ b/src/config/yaml.rs @@ -67,6 +67,7 @@ where #[serde(default)] pub struct Cheats { pub path: Option, + pub paths: Vec, } #[derive(Deserialize)] @@ -159,7 +160,10 @@ impl Default for Finder { impl Default for Cheats { fn default() -> Self { - Self { path: None } + Self { + path: None, + paths: Vec::new(), + } } }